Updating field data by entry

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an form where as I mark 1 field: STATUS to "complete"; I want another
field: CompletedDate to update to the current date.
The Status field has several different conditions: Complete, Cancelled, In
Work and once any of these are set the corresponding date field needs to
update. Can I use the built in "OnUpdate" property box?
 
Ricky11 said:
I have an form where as I mark 1 field: STATUS to "complete"; I want another
field: CompletedDate to update to the current date.
The Status field has several different conditions: Complete, Cancelled, In
Work and once any of these are set the corresponding date field needs to
update. Can I use the built in "OnUpdate" property box?

Very close. Use the ... icon on the AfterUpdate property box, choose the
Code Builder, and put in code like

Private Sub STATUS_AfterUpdate() ' Access gives you this line for free
If Me!Status = "Complete" Then
Me!DateCompleted = Date
End If
End Sub

John W. Vinson/MVP
 
Back
Top