Printable Version of Topic

Click here to view this topic in its original format

UtterAccess Forums _ Access Code Archive _ Audit Trail Database - Made SUPER Simple

Posted by: dallr Jan 21 2008, 02:45 PM

Normally to setup any type of Auditing feature in a Microsoft Access database would involve a lot of custom coding. But, I have good news for you......

The code in the attached database allows anyone to setup auditing features within your database with as little as 4 to 5 lines of code. It is so easy, even if you open Access for the first time ever today , you can encorporate it into your DB.

The Audit table stores the following information on each update of a record:
1.The name of the form that the change was made from.
2.The RecordSource that the form was bound to i.e (Table or Query)
3. Name of the Field that the data was changed from.
4. The Previous Data Value.
5. The New Data Value
6. The Time the change took place (Date and time)
7. The name of the person who logged onto the computer.

Attached you will find a sample database and a Tutorial on how to use the code.

Have Fun

Dane

1/31/2008:
I have made some improvements to this audit trail db.
1. Added the ability to store the primary key so you know which record the data was changed from.
2. Also include the ability for you to easily pass the person who is logged into the database , instead of the person who is logged into the computer. This however you will need custom security using a log on form. There are many examples on UA but here is one I posted that enables you to disable form & report controls depending on who is logged on. http://www.utteraccess.com/forums/showflat.php?Cat=&Board=48&Number=1333453&Zf=f48&Zw=&Zg=0&Zl=a&Main=1333453&Search=true&where=&Zu=67878&Zd=l&Zn=&Zt=c&Zs=&Zy=#Post1333453&Zp=

PS: I would also like to single out the following VIPS: http://www.utteraccess.com/forums/uauserpro.php?User=96670 and http://www.utteraccess.com/forums/uauserpro.php?Cat=&User=107653&what=online for helping out and giving pointers on how to shorten the code in the class modules.

Dane


01/23/08 EDIT: Updated attachment with a sample that capture checkboxes. Doug
01/31/08 EDIT: Updated attachment to version 3. Added additional comments by Dane. Doug

 Audit DB - Made Super Simple- Version 3.zip ( 48.1K ): 3431
 

Posted by: 2ME Oct 30 2019, 12:11 PM

thank you very much for your effort dallr

I used your code and the Advanced custom security you refered to, what I need to do is to save the user logged to db using logon form instead saving the computer name

what do I need to alter in your code to do that

Thanks in advance for your help

Posted by: cheekybuddha Oct 30 2019, 01:53 PM

@2ME,

Dane (dallr) posted this sample 11 years ago!

I suggest you create a new thread with the problem you are experiencing, and post a link to this thread. More members will then be likely to jump in to help

hth,

d

Posted by: led123 Feb 16 2020, 05:59 AM

What do you mean by;

2. Now inside the form On Current event , set your pointer to the class and pass your form controls (Combo box , Text box and CheckBox only) to the relevant method (i.e .FormControl) ?

e.g how do i go about coding this into the form?

Posted by: cheekybuddha Feb 16 2020, 11:13 AM

@led123

welcome2UA.gif

May I suggest you follow the same advice I gave to 2ME in Post#2.