UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Audit Trail And Update Tables Using 1 Query    
 
   
Hein
post Oct 19 2011, 01:44 PM
Post #1

UtterAccess Veteran
Posts: 384
From: The Netherlands



Hi all,

I have included the fields DateAdded and DateChanged in every table.
When a new record is added the field DateAdded is updated with the value now().
When a record is changed the field DateChaned is updated.
Apart from this I have a tabel AuditTrail. When a record changes the old and new values are stored here.

When I am working on 1 of my forms all these actions are covered using VBA. This works fine.

My question: (more than) sometimes I change records with (ad hoc) queries which are not stored.
Does anybody know, or have experience, to capture the above mentioned actions (update the audit trail and update the field DateChanged) without having to make or save 1 or more queries?

Thanks in advance
Hein
Go to the top of the page
 
+
Jeff B.
post Oct 19 2011, 01:46 PM
Post #2

UtterAccess VIP
Posts: 8,166
From: Pacific NorthWet



Hein

If you are using Access 2010, there are "data macros" you can use when values are changed in tables. These are similar to "triggers" in SQL-Server.

Before Access 2010, not so much!
Go to the top of the page
 
+
Hein
post Oct 19 2011, 01:50 PM
Post #3

UtterAccess Veteran
Posts: 384
From: The Netherlands



Alas,

I am using Access 2002.
Thanks for your input Jeff!

Hein
Go to the top of the page
 
+
vtd
post Oct 19 2011, 09:40 PM
Post #4

Retired Moderator
Posts: 19,667



If you use Audit Trail Table, you must use Forms to add/edit data since the Form Events are required to add audit records into the Audit Trail Table!

Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th May 2013 - 10:37 PM