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

Create Log

Status
Not open for further replies.

bkrampe

IS-IT--Management
Nov 30, 2006
77
US
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...

--------------------
Procrastinate Now!
 
Did you even TRY to look at the FAQs ?
faq181-2399

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
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
 
the faq referenced above is a better soloution (at least for me)



MichaelRed


 
Seems the Audit trail download is no more downloadable ...
Anyway, here another FAQ on the topic:
faq181-291

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top