Windows username

R

Rudy. W.

I have a MS Access database running under Citrix.
Working tables who are created, used and deleted again
can not be used by more than one user.
Therefore I want to add the username of the user who
logged in on Citrix to the table names.
e.g.
Docmd.RunSQL "CREATE TABLE tblSelect" & strUser & " (..."

where de variable strUser contains the username.

So my question is how can I get the username in my Access
application?
It's the same name that you get when use the command
"echo %username%" in MS DOS.

Thanks
 
G

Guest

Thanks Roger,

I found an other solution:

I use the function Environ with parameter "USERNAME"
So Environ("USERNAME") gives me exactly what I want

R.W.
 
R

Roger Carlson

I used to use this solution as well, but it assumes that there is an
environment variable set up on each machine. This may not be the case, but
everyone has to log into the network.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top