I'm trying to set up a simple login screen for users to access one of the forms. Right now I'm keeping things simple and using their names as the login and then a password stored in a table. The login is a combo box in which they select their names, then they type in their password below and click on a command button to execute. I'm trying to use this code to make it all work:
Private Sub Command11_Click()
If Me.txtPassword.Value = Me.cboLogin.Column(5) Then
DoCmd.OpenForm frmTimeSheet, acNormal, , , acFormEdit, acWindowNormal
Else
MsgBox "Password Invalid. Please Try Again."
End If
End Sub
But it doesn't seem to be working. The button takes me to the right form, but if I type in the wrong password it still takes me to that form which tells me this isn't working right. Both the login and password fields are unbound for the obvious reason that I don't want to be storing this over and over again.