Grabbing User Name

Amy35

Registered User.
Local time
Today, 16:17
Joined
Mar 12, 2002
Messages
53
I am running Access 2000 in an NT environment. I have a form where there's a text box for the LAN ID. I'd like to have that field filled automatically from the Window's registry. I know you can use %username% to grab the lan id. I'm just not sure where to code it so it can automatically be filled in when the form is opened. Thanks in advance for any help!

Amy
 
I'm not positive, but I believe the command is 'GetCurrentUserName', as in:

LogonName = GetCurrentUserName()

Hope that's it!

EDIT: Whoops...helps if I spell the command correctly..
wink.gif


[This message has been edited by Jonathan Kok (edited 03-12-2002).]
 
I believe in a pure post-Win98 environment you can use = Environ("UserName"). The Environ function contains a lot of information, cycle through it with Environ(x).

HTH,
David R
 
Thanks for your help! I'll give it a try.

Amy
 

Users who are viewing this thread

Back
Top Bottom