UserID

R

Rich

Hi All

Can anyone let me know how to pick up the user ID off the network to
populate a field automatically on Access

Cheers
 
L

Larry Linson

R

Rich

Hi Larry

Thanks for this, tried the CurrentUser() as you say it returns Admin, I am
using Access 2007 and trying to find a way to to pick up the userId of the
current user.

I have also tried usedname, and userid

Any help would be grateful received

Cheers
Richard
 
A

Albert D. Kallal

Rich said:
Hi Larry

Thanks for this, tried the CurrentUser() as you say it returns Admin, I am
using Access 2007 and trying to find a way to pick up the userId of the
current user.

okay so the above means you're not using workgroup security. that means
you'll have to use in one of the other two suggestions that Larry gave:

they are:

You can get the current network logon name with:

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

And, the current computer name with:

http://www.mvps.org/access/api/api0009.htm

So, if you looking for the logged on name..choose the network logon code
from above.

You place that code in a standard code module (make sure it compiles After
you paste the code into a module).

You can then simply use the function name for the default in the forms
"default" setting for the that a killer picks box on the screen.

eg:

=fosusername()
 
L

Larry Linson

Thanks for this, tried the CurrentUser() as you say it returns Admin, I am
using Access 2007 and trying to find a way to to pick up the userId of the
current user.
I have also tried usedname, and userid

What "UserID" or "UserName" did you expect to obtain? Workgroup security is
no longer supported in Access 2007, so you can't obtain the Access login
name, which is the purpose of CurrentUser(). The Windows username may quite
possibly be the same on multiple machines in a network, so could well be
duplicated if you found the API for that. Network Login seems to me to be
your best bet at actually identifying the user.

I just thank my lucky stars that they retained CurrentUser() and return
_something_, so all my users' databases don't crash when they are executed
after being converted to Access 2007.

Larry Linson
Microsoft Office Access MVP
 
Top