Network username

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can anyone tell me the easiest way to get a username from the currently
signed on user and populate a field on a form or in a table?
 
text13.value = environ("Username") will put user's name in text13 (textbox)

Please take the time to rate this post below...
thanx
bac
 
I always cringe when people suggest using an environment variable for this
purpose, given how easy it is to reset an environment variable.

Far safer, in my opinion, is to use the GetUserName API call. See
http://www.mvps.org/access/api/api0008.htm at "The Access Web" for a
complete sample.
 
OK I did the following and I can not get the user name to poulate the field

Private Sub ChargebackType_AfterUpdate()

Call fOSUserName

Me.txtUser = strUserName

End Sub
 
fOSUserName is a function, not a sub.

Private Sub ChargebackType_AfterUpdate()

Me.txtUser = fOSUserName()

End Sub

Make sure you didn't name the module fOSUserName, by the way.
 
You know the expression "can't see the forest for the trees"? Well I feel
like that now, I should have realized that when I got the code.
 
Back
Top