Thanks Om for the help and your patients!
I tried your above code and came up with an error again in the highlighted yellow line. The error is: Runtime Error 3001
I need the LogInName to match the LogInPassword in the same row. Doesnt the EOF simply give a true or false statement? I really need to figure out how to search for the specific value in a field then validate with another field in the same row. Hope this makes a little sense. Perhaps I could Email you the project to proof. Thanks again for taking me under your wing on this.
Private Sub txtLogInPassword_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then 'ENTER key press'
LogInName = UCase(txtLogInName.Text)
LogInPassword = UCase(txtLogInPassword.Text)
LOGINrset.Open "SELECT * FROM [Login] WHERE UserName = '" & LogInName & "'", DBconnection, adOpenStatic, adLockReadOnly
If LOGINrset.EOF Then
MsgBox "INVALID LOGIN NAME..."
End
Else
If LogInPassword = DBconnection.LOGINrset(Password).Value Then
Unload frmINTRO_window
End
Else
BadLogInCount = BadLogInCount + 1
If BadLogInCount = 3 Then
Unload frmINTRO_window
End
Else
txtLogInName.Text = ""
txtLogInName.SetFocus
MsgBox "INVALID PASSWORD..."
End If
End If
End If
End If
End Sub
|