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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating Current User and Date 2

Status
Not open for further replies.

dabones99

Technical User
Oct 4, 2002
20
US
I have created a form to accept data from the user. I have two hidden text boxes that update the Current User and Date. When a new record is added everything works fine but when I am making changes to an existing record those two fields retain the old date and the old User.

How can I get those two fields to be updated when I am just editting a record? Please help.

Marlon
 
I use the Before_update event for the form to change to the new value

ie.

Private Sub Form_BeforeUpdate(Cancel As Integer)
[Last Updated] = Now 'Set time and Date
[Updated by] = "(" & Environ("Username") & ")"
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top