Audit Trail

M

Mike C.

Hello.

I recently added an "audit trail" to one of my forms in
order to see what changes have been made to a specific
record. I got this code from the MS Knowledge Base

http://support.microsoft.com/default.aspx?scid=kb;en-
us;197592&Product=acc2000

The code works perfectly once intergrated into my
database. It shows every field on the form, about 30 or
so, and what changes, if any, were made to them. The
thing is, it shows ALL activity that was made - meaning it
keeps track EVERY time the form is updated (i.e. if a
change was made on 3/22/04, it shows all field activity,
then if a change was made on 3/24/04, it once again shows
all field activity in addition to the activity that was
made on 3/22/04) This causes Audit field to eventually
contain hundreds of lines of data.

Is there a way to ammend the code so that it shows only
the LAST changes that were made instead of ALL?

Thanks in advance,

MC
 
E

Elwin

Near the top of your function (line 5?) you've got...

MyForm!Updates = MyForm!Updates & Chr(13) & Chr(10) & _
"Changes made on " & Date & " by " & CurrentUser()


Change it to...

MyForm!Updates = "Changes made on " & Date & _
" by " & CurrentUser()


This will drop the existing value in the 'Updates' control
and start fresh.
 
M

Mike C.

Thanks alot. This worked great.

m.
-----Original Message-----
Near the top of your function (line 5?) you've got...

MyForm!Updates = MyForm!Updates & Chr(13) & Chr(10) & _
"Changes made on " & Date & " by " & CurrentUser()


Change it to...

MyForm!Updates = "Changes made on " & Date & _
" by " & CurrentUser()


This will drop the existing value in the 'Updates' control
and start fresh.

.
 
C

Cecil

I implimented this into my database and it works great. I
do have one question though...

My database requires that user logs onto the database in
order to get access and they have certain rights which
allow them to do certain actions and see certain fields.
These members are stored in the backend of the database in
a table name "tblRights". Some of the fields are:

LoginName
Password
BasicData

How can I make it so that when the logged in user (i.e.
DoeJ) makes a change, their login name pops up in the
audti trail? Right now the audit trial puts in "Changes
made on 3/25/04 by Admin" I assume "Admin" is based on
the user who logged into the Windows NT/2000 machine. I
assume this as something to do with the "CurrentUser()"
line in the code:

MyForm!Updates = MyForm!Updates & Chr(13) & Chr(10) & _
"Changes made on " & Date & " by " & CurrentUser()

Any help would be appreciated.

Thanks in advance,

C.
 

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