According to help:
'You can use this action to prevent modal warnings and message boxes from
stopping the macro. However, error messages are always displayed.'
Mostly I've used SetWarnings False to disable, er, warnings before deleting
records and similar. In other words to hide the 'are you sure' type
messages. Yours isn't an 'are you sure' type message, more a sort of 'enough
already, there ain't no more goddam records, ok buddy?' type message.
Anyway, if you've gone to the trouble of writing custom navigation buttons,
you should catch the no-previous-record and no-next-record cases for the
first and last records, otherwise you've got even less functionality than
the built in access nav buttons.
Oh, and by the way, although SetWarnings probably isn't going to work here,
if you do use it in the future, remember to put a SetWarnings True in your
exit sub, otherwise if the error occurs after the false but before the true
then warnings will still be off.
Sam
"ken" <ge****@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
It still does that. I think because its not a warning, but an error
that I'm getting.
Here is my code
On Error GoTo Err_BUT_PREV_REC_Click
DoCmd.SetWarnings False
DoCmd.GoToRecord , , acPrevious
DoCmd.SetWarnings True
Exit_BUT_PREV_REC_Click:
Exit Sub
Err_BUT_PREV_REC_Click:
MsgBox Err.Description
Resume Exit_BUT_PREV_REC_Click
End Sub
After the second docmd that tells the form to go back one...it goes to
the err handler.
There is no error number though...just a message "Can't go to specified
record" with an ok button.