Is there any way to create a log, maybe in a text file, whenever something in a particular field is changed. I need it to date and time stamp it. And i need it to not write over what was previously stamped. Or i could do separate files if I had to.
well, you can just setup a audit table or something similar...
however access doesn't have triggers, so in order to log each action, you'll have to force the users to use forms which you've set up which contain code that will insert records into the audit table whenever a specific change is made...
Adept the following as you need. TxtTimeStamp and TxtDateStamp are hidden textboxes bound to fields in the table. If you what use the IF statements only to include everyone.
Private Sub Unit_AfterUpdate()
Dim AudName As String
Dim Uname
AudName = Environ("UserName")
Uname = AudName
Select Case (Uname)
Case "rhood", "bgreene"
If IsNull(Forms!frmYourForm!TxtTimeStamp) Then
Forms!frmOdometers!TxtTimeStamp = Time
End If
If IsNull(Forms!frmYourForm!TxtDateStamp) Then
Forms!frmOdometers!TxtDateStamp.Value = DateSerial(Year(Now()), Month(Now()), Day(Now())) 'Date
End If
Case Else
End Select
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.