Save user's name

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

We have a corporate network with Win2000 installed on each
computer. Each user has its own login and password for
entering the network.
There is a database on the network. I would like to make a
field in the main table for saving the name of the user,
who created the record.
Is it possible for Access to retrieve the login name of
the user (from Win2000) and automatically save it with the
record?
 
Mike said:
We have a corporate network with Win2000 installed on each
computer. Each user has its own login and password for
entering the network.
There is a database on the network. I would like to make a
field in the main table for saving the name of the user,
who created the record.
Is it possible for Access to retrieve the login name of
the user (from Win2000) and automatically save it with the
record?

See code at link below.

http://www.mvps.org/access/api/api0008.htm
 
Hello Mike,

First, copy the code found at :

http://www.mvps.org/access/api/api0008.htm

to a public module in your database.

Then, if you have not already done so, create a field in your table named:
CreatedBy.
On the form where your users are entering records, add a Text Box control
and bind it to your CreatedBy field. Then, in the Properties of the
control, add the following to the Default Value property:

=fOSUserName()


hth,
 
Cheryl,

I have a realted question I hope you can help me with. I
would like to use the code provided below to log my users
into the database as an Access Security User I have setup
to match the network ID. My thought was that you would
log in as "admin", run some magic code and change the user
to "jim_smith", or whatever their network ID is. Any
ideas?

Thank you,

sabloomer
 
My thought was that you would
log in as "admin", run some magic code and change the user
to "jim_smith", or whatever their network ID is. Any
ideas?

I don't believe you can do that; however, I suggest you start a new thread
with your question.
 
Back
Top