Windows username

  • Thread starter Thread starter Rudy. W.
  • Start date Start date
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
 
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.
 
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.
 
Back
Top