G Guest Jun 17, 2005 #1 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?
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?
G Guest Jun 17, 2005 #2 text13.value = environ("Username") will put user's name in text13 (textbox) Please take the time to rate this post below... thanx bac
text13.value = environ("Username") will put user's name in text13 (textbox) Please take the time to rate this post below... thanx bac
D Douglas J. Steele Jun 17, 2005 #3 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.
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.
G Guest Jun 20, 2005 #4 Thanks Douglas I think this will work great. Douglas J. Steele said: 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. Click to expand...
Thanks Douglas I think this will work great. Douglas J. Steele said: 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. Click to expand...
G Guest Jun 20, 2005 #5 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
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
D Douglas J. Steele Jun 20, 2005 #6 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.
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.
G Guest Jun 21, 2005 #7 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.
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.