Hi
I'm sure this has been answered several times, but I can't find the right thread to give me the answer.
I have this piece of code in an access 2000 database
Private Sub cmdNext_Click()
On Error GoTo Err_cmdNext_Click
DoCmd.GoToRecord , , acnextExit_cmdNext_Click:
Exit Sub
Err_cmdNext_Click:
MsgBox Err.Description
Resume Exit_cmdNext_Click
End Sub
If I am on the last record I get the error message "you can't go to the specified record."
I would like to trap this error and put out my own msgbox with something more informative, but I am not triggering the error routine in the sub.
I know this beacuse I have tried putting my own message in the msgbox line and I still get the standard one.
How can I stop the standard message and put my own in instead
Thanks
Sue
I'm sure this has been answered several times, but I can't find the right thread to give me the answer.
I have this piece of code in an access 2000 database
Private Sub cmdNext_Click()
On Error GoTo Err_cmdNext_Click
DoCmd.GoToRecord , , acnextExit_cmdNext_Click:
Exit Sub
Err_cmdNext_Click:
MsgBox Err.Description
Resume Exit_cmdNext_Click
End Sub
If I am on the last record I get the error message "you can't go to the specified record."
I would like to trap this error and put out my own msgbox with something more informative, but I am not triggering the error routine in the sub.
I know this beacuse I have tried putting my own message in the msgbox line and I still get the standard one.
How can I stop the standard message and put my own in instead
Thanks
Sue