Find current username and store in temp table

P

Presto

Access 2003 on WinXP Pro or Win2003 Server.

How can I get the current username logged on to the computer, and store that
value in a temp table to use later?
On db close, the temp table record will be deleted.

I have a form that pops up after you do certain db maintainence and I want
to log information about the work completed, including the username. I do
not want the current user to be able to change the username on the form, so
that field will be hidden or uneditable. The form will have today's date, a
combo box , 2 memo fields and a Yes/No check box.

Temp Table: tblLoggedUser
Field: CurrentUser (<<< This is where I want to store the usernames )

Table Name: tblLogWork
Fields: txtCurrentUser, dteLogDate, txtChangeType, memLogComments ,
memToDoList , ynCompleted
 
A

Arvin Meyer [MVP]

This will get the current username:

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

Just run the function and set a bound textbox from a form bound to the temp
table to the function:

=fOSUsername()

You might want to use a different field name for the current user, since
CurrentUser is a reserved word for a function in an Access security model.
Try using: UserName.
 
P

Presto

Thank you Mr. Meyer.
I will give this a try.

Arvin Meyer said:
This will get the current username:

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

Just run the function and set a bound textbox from a form bound to the
temp table to the function:

=fOSUsername()

You might want to use a different field name for the current user, since
CurrentUser is a reserved word for a function in an Access security model.
Try using: UserName.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 

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