Hello,
I suspect this is just me not knowing what I'm doing (again), but...
I have a form, which has a subform on it. In that subform, I have two command buttons, which I'm attempting to turn into navigation buttons by adding the following code into their OnClick events as [Event Procedure]'s:
..and a similar procedure for the "Next" button.
However, Access keeps throwing the following error when I click on either button:
I'm pretty certain it's not the navigation code that's the problem - why can't I called a code block/Event Procedure from a command button this way?
Thanks for any help
I suspect this is just me not knowing what I'm doing (again), but...
I have a form, which has a subform on it. In that subform, I have two command buttons, which I'm attempting to turn into navigation buttons by adding the following code into their OnClick events as [Event Procedure]'s:
Code:
Private Sub cmdPrev_Click()
'prevent form from adding new record
Me.AllowAdditions = False
'attempt to navigate to prev record
On Error Resume Next
DoCmd.RunCommand acCmdRecordsGoToPrevious
Select Case Err.Number
Case 0
'no error
Case NO_NEXT_RECORD
'first record reached
Case Else
'unexpected error
MsgBox Err.Description, vbExclamation, "Error"
End Select
End Sub
..and a similar procedure for the "Next" button.
However, Access keeps throwing the following error when I click on either button:
I'm pretty certain it's not the navigation code that's the problem - why can't I called a code block/Event Procedure from a command button this way?
Thanks for any help