Im having a problem with my login page. i have a simple form with username and password. i used to have the username as a textbox, and the below code worked fine, replacing combo with username, but i decided i wanted a dropdown for the usernames so i deleted the textbox and created a combobox (named combo) but now i always get the else statement MsgBox "Incorrect Login Details Please Try Again" can someone tell me where im going wrong.
Private Sub Command7_click()
combo.SetFocus
If combo = "Dean Robinson" And Password = "hollie" Then
MsgBox "Welcome Dean", vbInformation, "PDA TRACKING"
DoCmd.Close
DoCmd.OpenForm "Main Menu"
ElseIf combo = "Robert Curley" And Password = "Password" Then
MsgBox "Welcome Rob", vbInformation, "PDA TRACKING"
DoCmd.Close
DoCmd.OpenForm "Main Menu"
ElseIf combo = "Colin Rushbrooke" And Password = "Password" Then
MsgBox "Welcome Colin", vbInformation, "PDA TRACKING"
DoCmd.Close
DoCmd.OpenForm "Main Menu"
Else
MsgBox "Incorrect Login Details Please Try Again"
End If
End Sub