How do I get this form code (I found on the internet):
To instead of just checking if the username is manager1, to check the username and password directly from a table?
For school I need to make a login form, one for admin, one for customer and one for a visitor. I invision this: Login screen, login button, and a button called 'I'm a guest'.
I would need to make 3 switchboards, one for admin, one for customer and one for visitor.
Could someone give me some help or adjust the code I found please?
Username.SetFocus
If Username = "staff1" And Password = "staff1" Then
MsgBox "Access Granted", vbInformation, "CD Shop"
MsgBox "Welcome", vbInformation, "CD Shop"
DoCmd.Close
DoCmd.OpenForm "F_Switchboard"
ElseIf Username = "staff2" and Password = "staff2" Then
MsgBox "Access Granted", vbinformation, "CD Shop"
MsgBox "Welcome", vbinformation, "CD Shop"
DoCmd.Close
DoCmd.OPenForm "F_Switchboard"
ElseIf Username = "manager1" and Password = "manager1" Then
MsgBox "Welcome, Manager", vbinformation, "Manager Area"
MsgBox "Please Exercise Caution When Altering Back End", vbinformation, "Manager Area"
DoCmd.Close
DoCmd.OPenForm "F_Switchboard_Manager"
Else
MsgBox "Please re-enter your Username and Password."
End If
To instead of just checking if the username is manager1, to check the username and password directly from a table?
For school I need to make a login form, one for admin, one for customer and one for a visitor. I invision this: Login screen, login button, and a button called 'I'm a guest'.
I would need to make 3 switchboards, one for admin, one for customer and one for visitor.
Could someone give me some help or adjust the code I found please?