Thanks for the input and I have change the code to read "If Me.txtPassword <> Me.cboLogin.Column(1) Then" base on explanation but it still doesn't perform the check it just goes through and opens the form no matter what password has been entered. I am not sure what to do to perform the check. Please help.
Code:
Private Sub txtPassword_AfterUpdate()
Me.txtAccessLevel = Me.cboLogin.Column(3)
Me.txtPassword = Me.cboLogin.Column(1)
'Check that a user has been selected
If IsNull(Me.cboLogin) Then
MsgBox "You need to select a user!", vbCritical
Me.cboLogin.SetFocus
Exit Sub
End If
' Check for correct password
If Me.txtPassword <> Me.cboLogin.Column(1) Then
MsgBox "Password does not match, please re-enter!", vbOKOnly
Me.txtPassword = Null
Me.txtPassword.SetFocus
Exit Sub
End If
'Check if password needs to be reset
' If Me.cboLogin.Column(2) = True Then
' DoCmd.OpenForm "frmPasswordChange", , , "[UserLoginID] = " & Me.cboLogin
' DoCmd.OpenForm "frmPasswordChange", , , "[UserID] = " & Me.cboUser
'Else
If Me.txtAccessLevel = 1 Then
DoCmd.OpenForm "frmAdminMode"
Me.Visible = False
Exit Sub
End If
If Me.txtAccessLevel = 2 Then
DoCmd.OpenForm "frmManagers"
Me.Visible = False
Exit Sub
End If
' Else
If Me.txtAccessLevel = 3 Then
DoCmd.OpenForm "frmSupervisors"
Me.Visible = False
Exit Sub
End If
' Else
If Me.txtAccessLevel = 4 Then
DoCmd.OpenForm "frmStaff"
Me.Visible = False
Exit Sub
End If
'Else
' MsgBox "Password does not match, please re-enter!", vboOkOnly
' Me.txtPassword = Null
' Me.txtPassword.SetFocus
End Sub