Control to update date field if record has changed

  • Thread starter Thread starter Joe Donohue
  • Start date Start date
J

Joe Donohue

This is a basic question: could someone tell me how to set
a control in a form to update the date in a field if
anything has been changed in the record?

Thank you
 
This is a basic question: could someone tell me how to set
a control in a form to update the date in a field if
anything has been changed in the record?

In the form's "BeforeUpdate" event procedure, you could enter code similar to
this:

'***
'If you want only the date
Me![ModifiedDate] = Date()
'If you want both the date and the time
Me![ModifiedDate] = Now()
'***

Where "Me![ModifiedDate]" is the field that you want updated.
 
This is a basic question: could someone tell me how to set
a control in a form to update the date in a field if
anything has been changed in the record?

Thank you

Put some VBA code in the Form's BeforeUpdate event:

Private Sub Form_BeforeUpdate(Cancel as Integer)
Me!controlname = Now()
End Sub
 
Back
Top