Capturing Users ID

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible for me to capture in a field who created an entry. I want to
capture the UserID of the individual performing data entry on items or
modifying data. Is this possible, if so, HOW?
 
In conjunction with Jeff's suggestion, you would run code in the
BeforeUpdate event to show who modified the data, and in the BeforeInsert
event to show who added a new record. You could add columns to your tables
to hold this data, and do something like this:

Sub Form_BeforeUpdate(CAncel as Integer)
Me!strUpdatedBy = CurrentUser
Me!dteDateUpdated = Date
End Sub

Sub Form_BeforeInsert(Cancel As Integer)
Me!strCreatedBy = CurrentUser
Me!dteDateCreated = Date
End Sub

Allen Browne has a good tutorial on building an Audit Log here:
http://allenbrowne.com/AppAudit.html
 
Back
Top