How do I create a user activity log? This is to log of user activity in term of who create or delete an entry or make changes to it. Thank you for any help or in pointing to any prior forums that has this info. Thanks.
How do I create a user activity log? This is to log of user activity in term of who create or delete an entry or make changes to it. Thank you for any help or in pointing to any prior forums that has this info. Thanks.
I run Post2Log at the point a user does an event.
it posts to table: tLogs
usage:
Post2Log "fAccounts","delete rec", "Rec#:" & txtID
Code:Public Sub Post2Log(pvLoc, pvEvent, pvDescr) Dim sSql As String Dim vTime vUser vUser = Environ("Username") vTime = now() docmd.setwarnings false sSql = "INSERT INTO tLogs ([Location],[Event],[Description],[USER],[EntryDate]) values ('" & pvLoc & "','" & pvEvent & "','" & pvDescr & "','" & vUser & "',#" & vTime & "#)" DoCmd.RunSQL sSql docmd.setwarnings true End Sub
If you are looking for detailed record and field changes (Add, Modify, Delete) and a time stamp, then I suggest you search for Audit Log or Audit trail.
Here's one reference