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

create audit trail of data changes and export to table or file 3

Status
Not open for further replies.

kpalazzi

Technical User
May 2, 2000
35
US
I have a database with multiple forms.  I need to track data changes to the fields in each form. I would like to be able to copy each form and call it form.history.  Then use the before update procedure on the form to copy the record to another table or form before the changes are saved.  I tried the DoCmd.DoMenuItem and the outputTo commands and I can not get it to work.  I did get the form to post the date, user, field and old value in a field in the same form, but this method is not efficient to search the old values in the future.  Please Help
 
Before Update, try having it run an append query that has in the criteria of the primary key of your data that limits it to the record being shown on your form.&nbsp;&nbsp;Have the append query add the records to a copy of your original table called History (or whatever you want).<br><br>the code would be simple for it (if you didn't want to use Macros)...<br><b><br>DoCmd.SetWarnings False<br>DoCmd.OpenQuery &quot;YourAppendQueryNameHere&quot;<br>DoCmd.SetWarnings True<br></b><br><br>Do the SetWarnings so that you don't have that annoying error message pop up everytime you go to append a record. <p>Brian Famous<br><a href=mailto:bfamous@ncdoi.net>bfamous@ncdoi.net</a><br><a href= > </a><br>
 
Thank you for your fast response.&nbsp;&nbsp;I will give it a try.
 
That worked perfect and was so simple. Thanks for the post
 
see faq181-291 for an alternative approach.




MichaelRed
mlred@verizon.net

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top