Adding User ID to tables

  • Thread starter Thread starter BobbaLou
  • Start date Start date
B

BobbaLou

I am setting up a database with User ID's (not a secure DB). The user starts
Access and would login to the app. Eac entry made by the user would have his
entries tagged with his ID (name). Any suggestions to tie these out?
 
Paste the following code into a standard module by itself. DO NOT name the
module the same as the funtion name. Access will choak if you do.
The create a text box (it can be hidden if you want) on the form and bind it
to the field in the record source where you want to put the User ID. Then
make this the control source of the contro:
=GetUserID()

Simple as that.
 
Klatuu said:
Paste the following code into a standard module by itself. DO NOT name the
module the same as the funtion name. Access will choak if you do.
The create a text box (it can be hidden if you want) on the form and bind it
to the field in the record source where you want to put the User ID. Then
make this the control source of the contro:
=GetUserID()

Simple as that.

I would use the BeforeInsert event and put the value in the hidden
form field.

If someone else was to update that record, such as a manager who had
access to all the records, then their userid would be put into that
field. Or could be. I'd have to test the code a bit.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
Back
Top