User Tracking in Access

G

Guest

My office runs an Access database, and I have need to be able to view when
each employee logs in/logs out....Are there any thoughts on this??? I would
also like to be able to track whom was the last user to change a record...any
help would be appreciated.
Thanks
 
R

Rick B

Both of these are asked pretty often. Do a search and read the previous
posts on how to log user access to the database, and how to timestamp
changes. You could also look at how to do audit trails if you want to track
what changes were made to the data.
 
K

Keith

Cgilsy said:
My office runs an Access database, and I have need to be able to view when
each employee logs in/logs out....Are there any thoughts on this??? I
would
also like to be able to track whom was the last user to change a
record...any
help would be appreciated.
Thanks

Yes, Access can do this. Check out the help for the "ENVIRON" property. I
use this to gather network user information for audit purposes.

To track "last changed by" (and when) you'd need two new fields in your main
table, one for name and the other for date/time. You would update the
fields using your form's BeforeUpdate event. It is also possible to create
an audit trail of changes using a similar method. Hope that's enough to get
you started.

Regards,
Keith.
www.keithwilby.com
 
G

Guest

Keith,
How would you set up the code in the BeforeUpdate Event? I would like to use
this as well.

Thanks
 
K

Keith

Secret Squirrel said:
Keith,
How would you set up the code in the BeforeUpdate Event? I would like to
use
this as well.

Something like:

Dim strUserName As String
strUserName = Environ("USERNAME")
Me.txtUser = strUserName
Me.txtUpdated = Now()

Regards,
Keith.
www.keithwilby.com
 
G

Guest

Keith,
What if I wanted to expand this to show user tracking for each field? Can I
create another table to keep this information? If so, how would I go about
that?
 
K

Keith W

Secret Squirrel said:
Keith,
What if I wanted to expand this to show user tracking for each field? Can
I
create another table to keep this information? If so, how would I go about
that?

:

Yes, create a new table with fields for time stamps, user ID, record ID and
old and new values. You'd then need to use the before/after update events
on your forms to trigger the recording of the data. It's not a two minute
job though.

Regards,
Keith.
www.keithwilby.com
 
G

Guest

Ok I've followed the instructions from the link you gave me but I'm a little
unclear what he means by removing the 4 references to the function
"LogError()". Can you shed some light on how I remove these and where they
are located?
 
J

Joan Wild

I haven't used it, but a quick perusal... He says to "copy this code" to a
new module. If you search that code for logerror, you'll find 5 statements
like

Call LogError(....
Just put an apostrophe at the beginning of these lines.
 
G

Guest

Ok I did that now I'm getting an error "Method or data number not found".
Here is the line it is referring to. Can you help with this one?

Private Sub Form_BeforeUpdate(Cancel As Integer)

bWasNewRecord = Me.NewRecord
Call AuditEditBegin("tblRMA", "audtmpRMA", "RMA", Nz(Me.RMA, 0),
bWasNewRecord)
 
J

Joan Wild

That function has four arguments not five as in your statement.

Function AuditDelBegin(sTable As String, sAudTmpTable As String, sKeyField
As String, lngKeyValue As Long) As Boolean

It also appears as though your KeyValue might be null? That doesn't make
sense to me.
 
G

Guest

I figured out the problem for this one. He had "(Me.InvoiceID, 0)" on the
website. I changed it to "(Me!InvoiceID, 0)" and now it works fine. I guess
it was just a typo on his part. Unless I'm missing something here???
 

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

Similar Threads

Outlook Tracking category changes 1
Can Access create a tracking? 1
user-level security 2
Simple list of users 2
General security questions 4
User level Access 1
Access Employee testing checklist 0
Tracking Users in an Access 2000 database 6

Top