Here is the code I put it in a few areas and I get an error. I think I am missing something. Where would you put it?
Public Sub WrongValue()
On Error GoTo ErrorHandler
ContinueHere:
prompt$ = "Please enter class number."
Do
SearchStr$ = InputBox(prompt$, "CLASS NUMBER"

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 "You have entered a class number that is not correct. Please re-enter a correct class number", vbCritical
Resume ContinueHere
Else
MsgBox Err.Number & ": " & Err.Description 'this Catches other errors
Resume ContinueHere
End If
End Sub