Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Find current username and store in temp table

Geek News

Find current username and store in temp table
"Presto" <presto__NOSPAM[ at ]prestoweb.net> 11/24/2008 4:05:58 AM
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







Re: Find current username and store in temp table
"Arvin Meyer [MVP]" <arvinm[ at ]mvps.invalid> 11/24/2008 4:19:29 AM
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



"Presto" <presto__NOSPAM[ at ]prestoweb.net> wrote in message
news:%23JCZyneTJHA.4564[ at ]TK2MSFTNGP03.phx.gbl...
[Quoted Text]
> 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
>
>
>
>
>
>
>


Re: Find current username and store in temp table
"Presto" <presto__NOSPAM[ at ]prestoweb.net> 11/26/2008 7:22:13 PM
Thank you Mr. Meyer.
I will give this a try.

"Arvin Meyer [MVP]" <arvinm[ at ]mvps.invalid> wrote in message
news:u8qbbveTJHA.5244[ at ]TK2MSFTNGP04.phx.gbl...
[Quoted Text]
> 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
>
>
>
> "Presto" <presto__NOSPAM[ at ]prestoweb.net> wrote in message
> news:%23JCZyneTJHA.4564[ at ]TK2MSFTNGP03.phx.gbl...
>> 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
>>
>>
>>
>>
>>
>>
>>
>
>


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net