X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Audit Trail Database - Made SUPER Simple    
post Jan 21 2008, 02:45 PM

UtterAccess VIP
Posts: 3,085
Joined: 4-November 04
From: The Land of the Access Ninja's

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


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. Advanced Custom Password

PS: I would also like to single out the following VIPS: Ace and LPurvis for helping out and giving pointers on how to shorten the code in the class modules.


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
Attached File(s)
Attached File  Audit DB - Made Super Simple- Version 3.zip ( 48.1K )Number of downloads: 3468
Go to the top of the page
post Oct 30 2019, 12:11 PM

Posts: 751
Joined: 13-May 10
From: Egypt

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

Mostafa Osman
Go to the top of the page
post Oct 30 2019, 01:53 PM

UtterAccess Moderator
Posts: 13,042
Joined: 6-December 03
From: Telegraph Hill


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





David Marten
Go to the top of the page
post Feb 16 2020, 05:59 AM

Posts: 1
Joined: 16-February 20

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?
This post has been edited by led123: Feb 16 2020, 06:00 AM
Go to the top of the page
post Feb 16 2020, 11:13 AM

UtterAccess Moderator
Posts: 13,042
Joined: 6-December 03
From: Telegraph Hill



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



David Marten
Go to the top of the page

Custom Search

RSSSearch   Top   Lo-Fi    11th July 2020 - 05:54 AM