global/public variable

T

tracktraining

Hi All,

I have a Log in Form -- enter username and password. After the user enters
the information and it is correct, then the Main Screen switchboard opens
while the Log in Form closes. How do I store the username so I can still use
it in other forms? i.e. the username is connected to an access level and the
access level is connected to which form the user can open and can't.

Thanks,
Tracktraining
 
J

John W. Vinson

Hi All,

I have a Log in Form -- enter username and password. After the user enters
the information and it is correct, then the Main Screen switchboard opens
while the Log in Form closes. How do I store the username so I can still use
it in other forms? i.e. the username is connected to an access level and the
access level is connected to which form the user can open and can't.

Thanks,
Tracktraining

I'd just leave the login form open (you can set its Visible property to No to
hide it), and simply reference the form control from your other code.
 
D

Damon Heron

In a global module, add:
Public curUser as string

on the Log in form, assign the username to curUser (curUser= me.<yourtextbox
that has the username>)
then you can reference curUser from any form in your app.

Damon
 
Top