View Full Version : Can't go to specified record..


Amy35
05-24-2002, 04:22 AM
I have 4 navigation buttons (first, last, next and previous). I used the wizards to create them. Here's the code for the next button:

Private Sub cmdNext_Click()
On Error GoTo Err_cmdNext_Click

DoCmd.GoToRecord , , acNext

Exit_cmdNext_Click:
Exit Sub

Err_cmdNext_Click:
MsgBox Err.Description
Resume Exit_cmdNext_Click

End Sub

I found some code that grayed out the next button set focus to the previous button when the last record was hit. Obviously I couldn't get it to work on my form!

What can I put in this code and then modify for the previous button as well that will get rid of that "can't go to specified record" message?

Thanks for your help...

Amy

Rich
05-24-2002, 05:28 AM
Look up BOF EOF