K
kramer
for some reason the error handling is not working for me.
if the user is already on the first record and they click
on the previous record button, i would like to display a
custom message box instead of the generic "you can't go to
the specified record"
here is my code:
Private Sub cmdPrevious_Click()
On Error GoTo PreviousError
DoCmd.GoToRecord , , acPrevious
PreviousExit:
On Error GoTo 0
Exit Sub
PreviousError:
MsgBox "No Previous Customer Record", vbOKOnly +
vbInformation, "Customer Selection"
cboCardType.SetFocus
GoTo PreviousExit
End Sub
if the user is already on the first record and they click
on the previous record button, i would like to display a
custom message box instead of the generic "you can't go to
the specified record"
here is my code:
Private Sub cmdPrevious_Click()
On Error GoTo PreviousError
DoCmd.GoToRecord , , acPrevious
PreviousExit:
On Error GoTo 0
Exit Sub
PreviousError:
MsgBox "No Previous Customer Record", vbOKOnly +
vbInformation, "Customer Selection"
cboCardType.SetFocus
GoTo PreviousExit
End Sub