Audit Trail Problems

spectrolab

Registered User.
Local time
Tomorrow, 04:26
Joined
Feb 9, 2005
Messages
119
Hi All,

I am attempting to use the Audit Trail code form Allen Browne's excellent website and I am having a few issues.

In my forms Before Update Event I have the following

Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)

bWasNewRecord = Me.NewRecord
Call AuditEditBegin("tblLOIData", "audTmpLOIData", "ResultID", Nz(Me.ResultID, 0), bWasNewRecord)

End Sub

Unfortunately, when I go to compile the code it gives me an error.

Compile Error:

Method or Data not found

And the .ResultID is highlighted.

THe code for the module it refers to can be found at www.allenbrowne.com/AppAudit.html

if you need to see it.

I am using Access07 and I am not sure whether this a reference issue, but it is driving me crazy.

BTW, ResultID is the field in my table being audited that is the primary key and is an autonumber.

Any help would be greatly appreciated.
 
You need to reference the name of the control the resultid is displayed in not the actual field name.
 
Thanks Keith,

Only issue I have is that the ResultID is not on my form at all, do I need to add it? Can I add it but have it hidden?
 
Yeah, the easiest thing to do would be to put the field into a hidden control.
 

Users who are viewing this thread

Back
Top Bottom