Error msg when releasing form filter and acPrevious

J

JB_VB

I've created multiple linked forms and am using the filter , , , "RecordID =
" & Me.Record ID to have the forms stay on the same record. At the end of
the forms, I have a button to go to next record which works fine. At the
beginning of the form I have a Previous Record button that uses the standard
code with Me.FilterOn=False right after the On Error GoTo statement. When I
press the button, it goes to the previous record and gives me an error saying
"You can't go to the specified record".

While I don't care about the msg, it doesn't look good. Any advice on what
to tweak to fix this?

Thanks in advance!

P.S. Another error: At the end of the forms, I can advance 1 record then it
stays at the 2nd record. Even when I manually advance the records to 3 or 4,
when I hit the Next Record button it takes me back to record 2. Here's my
code:

Private Sub NextRecord_Click()
On Error GoTo Err_NextRecord_Click
DoCmd.OpenForm "PersonalData"
DoCmd.Close acForm, "Knowledge3"

DoCmd.GoToRecord , , acNext

Exit_NextRecord_Click:
Exit Sub

Err_NextRecord_Click:
MsgBox Err.Description
Resume Exit_NextRecord_Click

End Sub

Any suggestions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top