Control to update date field if record has changed

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
 
B

Bruce M. Thompson

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.
 
J

John Vinson

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
 

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