Timestamp/User stamp

  • Thread starter Thread starter Regina
  • Start date Start date
R

Regina

Guest
Hello,
I have two interlinked queries. I have just activated the admin account on my db hence a password is required at login. Evntually I want to set up user accounts, is there any way that a form can be "stamped" with the name of the user who made the changes? I would also like to timestamp the same form. I have created an " EnteredOn" field and inserted the code Forms![FormName]![EnteredOn] = Now in to the BeforeUpdate box. However it still does not timestamp and inserting the same text in AfterUpdate field causes even more problems. Can anyoine help? Thank you.
 
To insert a user in a field use currentuser()
 
try Forms![FormName]![EnteredOn] = Date()
 
How would you go about to only enter current user on new record. I don't want the program to change the user name that's entered for the last field. For example i have my access setup to grab =currentuser(). How would i set it up to grab current user only for new record. And do not change that value once it's setup.
 
When you are entering a new record, on the BeforeInsert of your first field (Have a field set on the table design for this value eg CreatedBy and make sure that it is included in the recordsource for the form)

Private Sub FirstField_BeforeInsert
Me.CreatedBy = CurrentUser()
Me.DateCreated = Date()
End Sub
 

Users who are viewing this thread

Back
Top Bottom