L
ladybug via AccessMonster.com
I am trying to make up my own security. So far I have been given help as you
will see below. I just have one more part that I need help on.
I have an unbound form called frm_login. This form has two unbound fields
called txt_login and txt_pw. I then have this code in a command button:
If IsNull(Forms!frm_login!txt_login) Then
MsgBox "Login is blank. Please enter login id.", vbCritical, "Login
Error"
Else
If IsNull(Forms!frm_login!txt_pw) Then
MsgBox "Password is blank. Please enter password.", vbCritical,
"Password Error"
Else
DoCmd.OpenForm "frm_auth"
If Forms!frm_auth!txt_authorized = 0 Then
MsgBox "The Login or Password you entered is not valid.
Please try again.", vbCritical, "Invalid User"
DoCmd.Close acForm, "frm_auth", acSavePrompt
DoCmd.Close acForm, "frm_login", acSavePrompt
DoCmd.OpenForm "frm_login"
Else
' myLogin = Forms!frm_auth!txt_login
' myRole = Forms!frm_auth!txt_role
DoCmd.Close acForm, "frm_auth", acSavePrompt
DoCmd.Close acForm, "frm_login", acSavePrompt
DoCmd.OpenForm "Switchboard"
End If
I have each login assigned a role. Multiple logins can have the same role.
Depending on the role assigned, will determine what command buttons are
available on the Switchboard. Examples of the roles are "QC" and "DE." What
code can I use to do this and where do I put it?
will see below. I just have one more part that I need help on.
I have an unbound form called frm_login. This form has two unbound fields
called txt_login and txt_pw. I then have this code in a command button:
If IsNull(Forms!frm_login!txt_login) Then
MsgBox "Login is blank. Please enter login id.", vbCritical, "Login
Error"
Else
If IsNull(Forms!frm_login!txt_pw) Then
MsgBox "Password is blank. Please enter password.", vbCritical,
"Password Error"
Else
DoCmd.OpenForm "frm_auth"
If Forms!frm_auth!txt_authorized = 0 Then
MsgBox "The Login or Password you entered is not valid.
Please try again.", vbCritical, "Invalid User"
DoCmd.Close acForm, "frm_auth", acSavePrompt
DoCmd.Close acForm, "frm_login", acSavePrompt
DoCmd.OpenForm "frm_login"
Else
' myLogin = Forms!frm_auth!txt_login
' myRole = Forms!frm_auth!txt_role
DoCmd.Close acForm, "frm_auth", acSavePrompt
DoCmd.Close acForm, "frm_login", acSavePrompt
DoCmd.OpenForm "Switchboard"
End If
I have each login assigned a role. Multiple logins can have the same role.
Depending on the role assigned, will determine what command buttons are
available on the Switchboard. Examples of the roles are "QC" and "DE." What
code can I use to do this and where do I put it?