PC Review


Reply
Thread Tools Rate Thread

audit users in ms database access 2003

 
 
=?Utf-8?B?Q2hhaQ==?=
Guest
Posts: n/a
 
      29th Mar 2006
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.
 
Reply With Quote
 
 
 
 
Douglas J Steele
Guest
Posts: n/a
 
      29th Mar 2006
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.



 
Reply With Quote
 
=?Utf-8?B?Q2hhaQ==?=
Guest
Posts: n/a
 
      29th Mar 2006
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.

>
>
>

 
Reply With Quote
 
Allen Browne
Guest
Posts: n/a
 
      30th Mar 2006
Temporarily comment out the error-handler in each of those routined, e.g.:
'On Error Goto...

You should now be able to see where the code is failing, and you can then
determine if it is a misspelling, or a field missing, or fields in the wrong
order, or ...

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Chai" <(E-Mail Removed)> wrote in message
news:B2DBFF34-93CB-4317-A9D2-(E-Mail Removed)...
>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.

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?Q2hhaQ==?=
Guest
Posts: n/a
 
      30th Mar 2006
I commented out the error-handler in each of the routines but it gave me more
problems. In my previous posting, I said that the audit table is only
recording records that are added but not records that are deleted/edited. I
don't know if the
the code in OnDelete, AfterDelConfirm, and BeforeUpdate are getting called.


"Allen Browne" wrote:

> Temporarily comment out the error-handler in each of those routined, e.g.:
> 'On Error Goto...
>
> You should now be able to see where the code is failing, and you can then
> determine if it is a misspelling, or a field missing, or fields in the wrong
> order, or ...
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Chai" <(E-Mail Removed)> wrote in message
> news:B2DBFF34-93CB-4317-A9D2-(E-Mail Removed)...
> >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.
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
Allen Browne
Guest
Posts: n/a
 
      30th Mar 2006
To test if the OnDelete code is being called, try deleting a record.
Provided the error handler is commented out, Access will highlight the
problem line of code when it fails.

You will need to have an understanding of VBA and SQL to understand what is
wrong and how to fix it. You will ultimately trace it to one of the things
listed in my previous reply.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Chai" <(E-Mail Removed)> wrote in message
news:18EC3870-49D7-4987-A674-(E-Mail Removed)...
>I commented out the error-handler in each of the routines but it gave me
>more
> problems. In my previous posting, I said that the audit table is only
> recording records that are added but not records that are deleted/edited.
> I
> don't know if the
> the code in OnDelete, AfterDelConfirm, and BeforeUpdate are getting
> called.
>
>
> "Allen Browne" wrote:
>
>> Temporarily comment out the error-handler in each of those routined,
>> e.g.:
>> 'On Error Goto...
>>
>> You should now be able to see where the code is failing, and you can then
>> determine if it is a misspelling, or a field missing, or fields in the
>> wrong
>> order, or ...
>>
>> "Chai" <(E-Mail Removed)> wrote in message
>> news:B2DBFF34-93CB-4317-A9D2-(E-Mail Removed)...
>> >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.

[snip]


 
Reply With Quote
 
=?Utf-8?B?Q2hhaQ==?=
Guest
Posts: n/a
 
      30th Mar 2006
I commented out the error-handler and found out that my temp table was
mispelled. Now when I edit/delete/add records it records it in the audit
table. Thanks a lot!!!!!!!!


"Allen Browne" wrote:

> To test if the OnDelete code is being called, try deleting a record.
> Provided the error handler is commented out, Access will highlight the
> problem line of code when it fails.
>
> You will need to have an understanding of VBA and SQL to understand what is
> wrong and how to fix it. You will ultimately trace it to one of the things
> listed in my previous reply.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Chai" <(E-Mail Removed)> wrote in message
> news:18EC3870-49D7-4987-A674-(E-Mail Removed)...
> >I commented out the error-handler in each of the routines but it gave me
> >more
> > problems. In my previous posting, I said that the audit table is only
> > recording records that are added but not records that are deleted/edited.
> > I
> > don't know if the
> > the code in OnDelete, AfterDelConfirm, and BeforeUpdate are getting
> > called.
> >
> >
> > "Allen Browne" wrote:
> >
> >> Temporarily comment out the error-handler in each of those routined,
> >> e.g.:
> >> 'On Error Goto...
> >>
> >> You should now be able to see where the code is failing, and you can then
> >> determine if it is a misspelling, or a field missing, or fields in the
> >> wrong
> >> order, or ...
> >>
> >> "Chai" <(E-Mail Removed)> wrote in message
> >> news:B2DBFF34-93CB-4317-A9D2-(E-Mail Removed)...
> >> >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.

> [snip]
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
2003 Access Secured Database - how to allow other users to login TxBlueEyes Microsoft Access Security 1 30th Jul 2008 08:32 PM
Change in Design while users are using the Database Access 2003 sarkar.sangeeta@gmail.com Microsoft Access Security 1 2nd Mar 2007 05:12 PM
Re: What is fastest way to give multiple users to Access 2003 database Douglas J. Steele Microsoft Access Getting Started 0 18th Jan 2007 06:28 PM
Multiple Users on an 2003 Access Database =?Utf-8?B?QWxhbks=?= Microsoft Access Security 1 20th Sep 2006 01:07 PM
Audit Trail for MS Access 2003 Database =?Utf-8?B?RERyb3dl?= Microsoft Access 10 14th Aug 2006 11:41 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:30 PM.