When I enter an invalid user id, I get the message "No current record". When I run the program in debug, the error message appears on the Seek line. It does not check for the NoMatch at this point. Once I click on the OK button for the error message, then my msgbox with error message pops up. How can I stop the No current record error message from showing? Any help would be greatly appreciated. Thanks in advance.
login:
Usr = InputBox("Enter User ID"
If Usr <> "" Then
datUser.Recordset.Seek "=", Usr
If datUser.Recordset.NoMatch Then
MsgBox "Invalid User Name, try again!", , "Delete User"
GoTo login
End If
End If
login:
Usr = InputBox("Enter User ID"
If Usr <> "" Then
datUser.Recordset.Seek "=", Usr
If datUser.Recordset.NoMatch Then
MsgBox "Invalid User Name, try again!", , "Delete User"
GoTo login
End If
End If