Allen Browne's audit table

T

TESA0_4

Hi,
Thanks to this discussion group I discovered Allen Browne's audit table
utility. I installed it as per instructions (I think) and found that editing
and inserting records were being recorded (almost correctly) but that delete
transactions were not being recorded. After some testing I found that the On
Delete event was not firing. After thinking awhile I realised that the way I
had coded my Delete command button was the problem so I moved the On Delete
and AfterDelConfirm code into my cmdDelete subroutine as follows:

Call AuditDelBegin("tblRiskAssess", "audTmpRiskAssess", "QRID",
Nz(Me.txtQRID, 0))
strSQL = "DELETE * FROM tblRiskAssess " _
& "WHERE QRID = " & Me.QRID.Value
CurrentDb.Execute strSQL
Call AuditDelEnd("audTmpRiskAssess", "audRiskAssess", status)

I also found that I had to declare status as an integer.

With these changes I find that I now get deletes recording to the Audit table.

However, the enduring problem is that when I do an Insert or Edit
transaction, these transaction cause any previous records in the permanent
Audit table to be deleted. In other words, my Audit table only holds the last
transaction to be performed if the last transaction was an edit or insert.

Does anyone have any suggestions about what is going on??? (I am still
developing the application so the database has not been split into front and
back ends).
 
T

TESA0_4

Ahhh! Things are always clearer in the morning!! I just discovered that I had
put the BeforeUpdate code in the BeforeUpdate event and!! the AfterUpdate
event. Audit now works a treat!

Thank you Mr Browne!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top