Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to populate fields automatically on update - username and time

Status
Not open for further replies.

train2

Technical User
Mar 18, 2003
47
GB
What a wonderful place this forum is. Thanks to this forum I've managed to capture the OS username for use in my database. A big step forward for someone of my abilities!

What I'd like to do is now to automatically capture the username and current date, when a record is updated. (the record is automatically generated with blank fields, then filled out manually by individual users). I've added a couple of new fields to the table (LastModifiedDate and LastModifiedUser) and would like these fields to be populated automatically. I'm using a form linked to a query to capture the data.

What I'm about to try is: default the fields using the functions available (NOW() and my Username function) and do that on OnRecordUpdate.... but I'm not sure if that's possible. If there is a better way, maybe you can advise me?
Thanks in advance.
JR
 
I think you've got the right idea. If that doesn't work, you could try the long way. That would be to put the exact same code on the AfterUpdate Event of any field that might be changed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top