Carmichael_NZ
New member
- Local time
- Today, 17:00
- Joined
- May 6, 2013
- Messages
- 4
Can someone please help me, I am having problems getting the following code to work with access 2010:
Option Compare Database
Private Sub Login_Click()
Username.SetFocus
If Username = "marsdenj" And Password = "a" Then
MsgBox "Welcome", vbInformation, "VidShop | Staff Only"
DoCmd.Close
DoCmd.OpenForm "Staff_Area"
ElseIf Username = "westene" And Password = "b" Then
MsgBox "Welcome", vbInformation, "VidShop | Staff Only"
DoCmd.Close
DoCmd.OpenForm "Staff_Area"
ElseIf Username = "mathewsj" And Password = "c" Then
MsgBox "Welcome", vbInformation, "VidShop | Staff Only"
DoCmd.Close
DoCmd.OpenForm "Staff_Area"
ElseIf Username = "moranp" And Password = "d" Then
MsgBox "Welcome", vbInformation, "VidShop | Manager Area"
DoCmd.Close
DoCmd.OpenForm "Manager_Area"
ElseIf Username = "admin" And Password = "admin" Then
MsgBox "Welcome", vbInformation, "VidShop | Manager Area"
DoCmd.Close
DoCmd.OpenForm "Manager_Area"
Else
MsgBox "Please re-enter your Username and Password", vbInformation, "Incorrect Username or Password."
End If
End Sub
Thanks
Option Compare Database
Private Sub Login_Click()
Username.SetFocus
If Username = "marsdenj" And Password = "a" Then
MsgBox "Welcome", vbInformation, "VidShop | Staff Only"
DoCmd.Close
DoCmd.OpenForm "Staff_Area"
ElseIf Username = "westene" And Password = "b" Then
MsgBox "Welcome", vbInformation, "VidShop | Staff Only"
DoCmd.Close
DoCmd.OpenForm "Staff_Area"
ElseIf Username = "mathewsj" And Password = "c" Then
MsgBox "Welcome", vbInformation, "VidShop | Staff Only"
DoCmd.Close
DoCmd.OpenForm "Staff_Area"
ElseIf Username = "moranp" And Password = "d" Then
MsgBox "Welcome", vbInformation, "VidShop | Manager Area"
DoCmd.Close
DoCmd.OpenForm "Manager_Area"
ElseIf Username = "admin" And Password = "admin" Then
MsgBox "Welcome", vbInformation, "VidShop | Manager Area"
DoCmd.Close
DoCmd.OpenForm "Manager_Area"
Else
MsgBox "Please re-enter your Username and Password", vbInformation, "Incorrect Username or Password."
End If
End Sub
Thanks