Simple Windows user identification (1 Viewer)

kodiak385

is using THE INTERNET!!1
Local time
Yesterday, 21:16
Joined
Jan 25, 2007
Messages
31
Okay, so I know there is a TON of stuff in this forum alone on how to secure an Access database based on Windows login information, and so I apologize for adding to the clutter out there, but that's actually the problem -- I can't seem to find exactly what I need among the threads and threads of related info.

What I'm looking for is the most simple, basic way to identify which Windows user is accessing the database. I'm NOT looking to actually SECURE the database (yet), I just want to see who's using it, and display information pertaining to that specific user (for one example, a personalized greeting upon opening, among other things).

To keep this in simplest terms, is there a single function that will identify a windows login? If not, what is the simplest way to find it, preferably without enabling Access security?

Thanks
 

rolaaus

Registered User.
Local time
Yesterday, 21:16
Joined
Feb 12, 2008
Messages
84
I think you are wanting the following
Code:
environ("username")
 

kodiak385

is using THE INTERNET!!1
Local time
Yesterday, 21:16
Joined
Jan 25, 2007
Messages
31
Actually, that brings up another issue...

pbaldy - thank you for your help, again :)

I pasted that code into a module, and it works like a charm. Thanks a ton.

As far as the Environ("username") solution goes, I was previously aware of this, but I'm having two issues with it. First, if I'm logged in, it simply returns "Admin," which I guess could work, but seems a little too generic (from what I understand, it's possible to have multiple users set as "admin," and who is admin can also change). Second, and more importantly for me, lately it's been simply triggering a "Enter Parameter Value" prompt asking for a value for Environ, and returning the #Name? error in the control in which it's used. No bueno. It used to work, but now seems to just be kaput. No idea what changed. :confused:

I'll be using Dev Ashish's code for this specific purpose, but even if I'm not using the Environ function, I'm actually getting similar symptoms (for other users, on other computers) for other functions that I KNOW are available -- things like Date() or Format(). What's worse is that on one of them (a fairly basic report), it's displaying a blank report and actually refusing to close. This is, as you can imagine, extremely frustrating. :mad: The other two users are also using Access 2003, so it shouldn't be a version issue, but I don't know what else it could be.

I know this is really taking a turn onto another topic - should I repost this as a new thread? Either way, if someone knows what's up, I'd reeeeeally like some help. Thanks.
 

kodiak385

is using THE INTERNET!!1
Local time
Yesterday, 21:16
Joined
Jan 25, 2007
Messages
31
Egads!!

:eek: HOLY FLYING MONKEYS THANK YOU SO MUCH!!


That was driving me CRAZY! It took some messing around, but I figured out that I had to unreference a few random libraries that were somehow inadvertently referenced, and it WORKS now! :D

Dude, if you were closer, I would hug you. haha
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 21:16
Joined
Aug 30, 2003
Messages
36,139
Well, I'll be driving up that way next month, but my wife is going to have some issues with unauthorized hugging. :p

Glad we got it sorted out.
 

Users who are viewing this thread

Top Bottom