Need code for record update

J

Jay Oken

I have two fields:

Date_Last_Updated
Last_Updated_By

How can I get these to update automatically when someone changes a record?
The first field should use the current date and the second field should use
the current user (I have security activated and have a user login list).

Thanks,
Jay
 
W

Wayne Morgan

In the form's BeforeUpdate event set the values of these two controls. If
the controls are bound to fields in the table, then the fields will be
updated when the record changes are saved.

Example:
txtDate_Last_Updated = Date
or to include time also,
txtDate_Last_Updated = Now

txtLast_Updated_By = CurrentUser
 

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