Navigation buttons

G

Guest

I have a form with a subform which also has a subform. I have out on my own
navigation buttons on all three forms. When running the subsubform on its own
my buttons work fine, but using the same code on the higher levels I get
error 3021 when scrolling through records. I think this is because I have
subforms with no records but the form I am navigating has a record.

How can I avoid this error - even getting access to ignore it would be fine!!!
 
G

Guest

Handle the error within the event procedure behind the button, e.g.

On Error Resume Next
DoCmd.GoToRecord , , acNext
Select Case Err.Number
Case 0
' no error
Case 3021
' anticipated error so do nothing
Case Else
' unknown error so inform user
MsgBox Err.Description, vbExclamation, "Error"
End Select

Ken Sheridan
Stafford, England
 

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