Hey
I want a simple login screen for my access file.
I have it all working with users in a table.
this code works fine
but i want to add another "if" statement if the login is correct.
I have a column in my access_table (where user info is stored) that is named "Role"
I want to send the user to different forms if he types in correct username and password.
If Role = Admin
go to xxxx form
If Role = User
go to yyyy form
how to ad this to my code?
I want a simple login screen for my access file.
I have it all working with users in a table.
this code works fine
Code:
If Me.txtPassword.Value = DLookup("Password", "Access_Table", "[User_ID]=" & Me.txtUsername.Value) Then
lngMyEmpID = Me.txtUsername.Value
'Close logon form and open splash screen
DoCmd.Close acForm, "Login_Form", acSaveNo
DoCmd.OpenForm "Main_Form"
Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!"
Me.txtPassword.SetFocus
End If
but i want to add another "if" statement if the login is correct.
I have a column in my access_table (where user info is stored) that is named "Role"
I want to send the user to different forms if he types in correct username and password.
If Role = Admin
go to xxxx form
If Role = User
go to yyyy form
how to ad this to my code?