<moosecck[ at ]gmail.com> wrote in message news:b362e51e-8f3e-4d13-9026-34866bfde4c7[ at ]k1g2000prb.googlegroups.com...
[Quoted Text] >I have a form called Edit Application which is used to pull a record > from the tblCreditApplicationInput table and display the record for > Editing. One field is called Date Rcvd, which was created when the > application is created. Another field is called status which uses a > combo box to pull 4 values-Draft, IN Process, Approved, Declined. My > client wants me to have the Date Rcvd value change to the current date > if the Status value is Draft and is changed to any of the other 3 > values. How do I get the system to look at the Status value in the > Status textbox before it processes the date change? Ex: If Status = > Draft and it is changed to any other value, change Date Rcvd to > current date, If Status is any of the other 3 values and changes to > any of the other values leave the date as is. This one is baffling > me. Any ideas would be greatly appreciated. > > Thanks > > Tom
If this is a bound form, then the Status control will have an OldValue property that holds its value before it was changed. Therefore, you can use the control's AfterUpdate event to check what just happened and change the date. For example,
'----- start of example code ----- Private Sub Status_AfterUpdate()
With Me!Status If .Value <> "Draft" Then If .OldValue = "Draft" Then Me![Date Recvd] = Date End If End If End With
End Sub '----- end of example code -----
-- Dirk Goldgar, MS Access MVP www.datagnostics.com
(please reply to the newsgroup)
|