Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get user login name 8

Status
Not open for further replies.

Darrylles

Programmer
Feb 7, 2002
1,758
GB
Hi all,

I've seen this solution in Tek-Tips, but I just cannot find it via 'search', I've saved the solution somewhere but can't find that either - lol.

What do I need to get the Windows user login name from within MS Access (via VB)?

This is for Win 2k and 98, but either will be appreciated (one will lead to the other).

Kind regards,

Darrylle





"Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
hdgirl,

What operating system are you using? and what version of access?

Ritec
 
This statement is false:

The problem with using global variables is, well, they're global. I.E., the variable will be loaded with the name of the latest user of the database.


Global variables stored in a code module, e.g.
Public String g_strUserName
are loaded per instance of Access and are totally independent. You are confusing global variables, stored in VBA code modules (or main memory, if we get technical) with globals stored on database tables.

Globals stored in a code module start up with a zero-equivalent value. For Strings, it is the empty string, vbNullString, so it's somewhat easy to test whether the global has been properly set before or not.
 
foolio12,

Thanks for your clarification... (Note pinking of face)

And, thanks for participating in Tek-Tips.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top