Module or code Audit Trail Log

hankins0005

New member
Local time
Yesterday, 23:14
Joined
Sep 13, 2017
Messages
3
I am using Access 2013 and I am in need of some code or module to capture changed to fields to include time/date old field/new field Form, and user can you give me a hand here

Regards
Tracy Hankins
U.S. Army Retired
 
i have a tLog table. It runs append queries at changes....
tLog:
Event,SubEvent,oldVal, newVal,user,TimeStamp

some events run the 'before' query at BeforeUpdate
then AFTERUPDATE, records the new values
like:
Event = "form"
subEvent="change Birthday"

I run it thru this Routine from any form, any module,etc...
Code:
Public Sub Post2Log(pvEvent, pvSubEvent, pvDescr, ByVal pvOld, byval pvNew )

vUser = Environ("Username")
sSql = "INSERT INTO tLog ([Event],[subEvent],[USER],[EntryDate],[OldVal],[NewVal] ) values ('" &  pvEvent &  "','" & pvSubEvent & "','" & vUser & "',#" & Now() & "#,'" & pvOld & "','" & pvNew & "',)"
DoCmd.RunSQL sSql
end sub
 
While there are exceptions, most people on this site will not have or offer the code that perfectly fits your needs, UNLESS you can show that you have made an honest effort in doing it yourself. Then there are tons of people that are willing help get you past your roadblocks.

Think of this site as an educational resource, rather than "I want, gimme!"
 

Users who are viewing this thread

Back
Top Bottom