Navigation buttons

  • Thread starter Thread starter Guest
  • Start date Start date
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!!!
 
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
 
Back
Top