Set global variable for login

RickDB

Registered User.
Local time
Today, 17:57
Joined
Jun 29, 2006
Messages
101
Hello,

I am trying to make a simple login system to store the user's name as a global variable for use throught the rest of the database (thanks KernalK).

There will be a text box named 'txtLogin' and a button named 'cmdLogin'. I plan to use an OnClick event to call a procedure to set variable 'glbUserID' to the text in 'txtLogin'.

tblEmployees has a field 'Initials' that I would like to verify the initials in txtLogin by.

Setting the variable on click is simple enough, but what is the If Else I would use to check the input against what is in tblEmployees before setting the variable?

I know this will be my Else statement:
MsgBox "Please enter a valid user name.", vbExclamation, "Invalid User Name"
Me.txtLogin.SetFocus

Thanks!
 
users's name (windows login) is available through environ("username") function if that's enough
 

Users who are viewing this thread

Back
Top Bottom