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

thread702-1740468 I have been ab

Status
Not open for further replies.

LyneGB

Technical User
Nov 8, 2016
1
US
thread702-1740468

I have been able to make the code work except for record deletions where a record gets created in the AuditTrail table but the record number for the deleted record, does not show up. I am wondering if it is because the sub calling AuditChanges is located in AfterDelConfirm event of the form, with the record number having been deleted before the AuditChanges is called. I could put the sub in the OnDelete event instead. Of course, if the user does not confirm the deletion, I will end up with a "fake" audit trail record. Or should I capture the record ID in the OnDelete event but only call AuditChanges in the AfterDelConfirm event? How would I transfer the information between the 2 events though? Thanks!!
 
Honestly, the code with the way pasted in the other thread is a pain to read.

When you say you want to capture the ID for the record deleted, then basically, you should just make sure you do something to this extent:
1. Build a query that captures all the details about the record to be deleted, and use that query as recordsource to add a history/audit trail record.
2. Use same query or build similar query to delete said record.

I didn't bother trying to dig through all the code, because I don't really have time. If you want to get into specifics, then post what you're trying to use so far here, and I'm sure someone can help show you where the problem lies.


"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top