Getting Windows User name??

  • Thread starter Thread starter Carlos
  • Start date Start date
C

Carlos

Hi,

Is there a way to grab a users windows login name?

I want to save this login name with every record saved in
a particular table.

So basically if they add a record it will take their
windows username so i can identify who made the
change/addition.

What is the code to do this?

Thanks in advance
 
Carlos said:
*Hi,

Is there a way to grab a users windows login name?

I want to save this login name with every record saved in
a particular table.

So basically if they add a record it will take their
windows username so i can identify who made the
change/addition.

What is the code to do this?

Thanks in advance *

--- vesa------------------------------

Dim User_Name as string

User_Name=Environ("USERNAME")

and why not simply to textbox

Me.tUser_Name.value=Environ("USERNAME")
 
vesa said:
--- vesa------------------------------

Dim User_Name as string

User_Name=Environ("USERNAME")

and why not simply to textbox

Me.tUser_Name.value=Environ("USERNAME")
------------------------------------------

A more reliable method is to use the Windows API since some
installations do not set this Environmental Variable:

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