Auto Date on any change of data in form

  • Thread starter Thread starter Debra
  • Start date Start date
D

Debra

I'm trying to have a date field automatically update to
the current date anytime there is a change or addition of
data on a form. Everything I've tried hasn't worked, but I
think it should be possible. Any help is appreciated.
Thanks, Debra =)
 
Assuming the date field is named "UpdatedOn", do this in the BeforeUpdate
event procedure of your form:

Private Sub Form_BeforeUpdate(Cancel As Integer)
Me.UpdatedOn = Now()
End Sub

Note that if you only want the date (not date and time), use:
Me.UpdatedOn = Date
 
Back
Top