Auto Date on any change of data in form

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 =)
 
A

Allen Browne

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top