I appreciate you taking time from your busy schedule to read and respond to
my email! It really means a lot to me knowing that there are people out
there willing to solve my problems!
I figured out what the problem was, I had mispelled the name of the table
which was being audited in two of the codes from Allen Browne's codes.
I have another problem, which you are trying to explain in your email. Now
I got the audit table to record something (YES!). It is only recording
records that are added, but not records that are deleted/changed.
I believe some of the event codes aren't being called in the form's events.
Why aren't the events being called?
Another thing: Below are codes in the form's events: If I take out the
brackets in "InvoiceID" I get this error: "Compile Error: Method or Data
member Not Found"
It works fine with the brackets. I think this may have something to do with
why the audit table isn't recording the deletions/changes.
Public Sub Form_AfterUpdate()
Call AuditEditEnd("Test", "audTmpTest", "audTest", "InvoiceID",
Nz(Me![InvoiceID], 0), bWasNewRecord)
End Sub
Public Sub Form_BeforeUpdate(Cancel As Integer)
bWasNewRecord = Me.NewRecord
Call AuditEditBegin("Test", "audTmpTest", "InvoiceID", Nz(Me.[InvoiceID],
0), bWasNewRecord)
End Sub
Public Sub Form_Delete(Cancel As Integer)
Call AuditDelBegin("Test", "audTmpTest", "InvoiceID", Nz(Me.[InvoiceID], 0))
"Douglas J Steele" wrote:
> Is the code in OnDelete, AfterDelConfirm, BeforeUpdate, and AfterUpdate
> actually getting called?
>
> Sometimes, modules get disassociated from the objects whose events they're
> supposed to be linked to.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
> "Chai" <(E-Mail Removed)> wrote in message
> news:CE6E7B80-E23E-4E73-A9C3-(E-Mail Removed)...
> > Hi, wondering if anyone out there can help me with this. I am using Allen
> > Browne's audit codes but it doesn't record any changes/additions/deletions
> to
> > the audit table.
> >
> > I think I followed through all the steps in AppAudit.html. I created a
> test
> > table named "Test" with two fields Fields1 and InvoiceID (AutoNumber). I
> > make a copy of "Test" and named it "audTempTest" changing InvoiceId to
> Number
> > Long Interger type , removing validation and primary key. I add 3 fields
> to
> > "audTempTest": audType, audDate, and audUser. I copy "audTempTest" and
> > named it "audTest" and add an autonumber filed named audID and make it
> > primary key.
> >
> > I copied the 6 lines of code to OnDelete, AfterDelConfirm, BeforeUpdate,
> and
> > AfterUpdate.
> >
> > I created a form to enter data to "Test" table. When I added/deleted/made
> > changes, nothing was recorded to audTest. Help!
> >
> > Thanks.
>
>
>