The if statement in your error handler is wrong.
Cange it from: If Error = 3421 Then
To:If Err.Number = 3421 Then
Thern add the label and the resume back as below.
Public Sub NoMatch()
On Error GoTo ErrorHandler
ContinueHere:
prompt$ = "Please enter class number."
SearchStr$ = InputBox(prompt$, "CLASS NUMBER"
Do
datClassEval.Recordset.Index = "PrimaryKey"
datClassEval.Recordset.Seek "=", SearchStr$
Loop While datClassEval.Recordset.NoMatch
txtLocator.Text = datClassEval.Recordset![LocNumber]
txtName.Text = datClassEval.Recordset![CLASS_NAME]
txtTrainer.Text = datClassEval.Recordset![REGISTRAR_INSTRUCTOR]
txtDate.Text = datClassEval.Recordset![Date]
txtHours.Text = datClassEval.Recordset![CLASS_HOURS]
Exit Sub
ErrorHandler:
If Err.Number = 3421 Then
MsgBox "Please enter correct value", vbCritical
Resume ContinueHere
else
msgbox err.number & ": " & err.description 'Catch other errors
End If
Thanks and Good Luck!
zemp