jazminecat
Programmer
Yes, I"m getting the dreaded "the open report action was cancelled" message - and I've searched the forums, and found the threads addressing it, tried out the code, and still get the error - here's my code:
Can anyone tell me why it's not ending the open report function and bailing? It goes back to my form correctly, but of course gives me the error as well. ANy thoughts? Thanks!
Code:
Option Compare Database
Private Sub Report_Open(Cancel As Integer)
On Error GoTo ErrHandler
Select Case Forms!RunQuery!Frame15
Case 1 'subrecipients
Me.RecordSource = "qrySubrecipient"
Me.Label22.Caption = "Subrecipients"
Case 2 'contracts
Me.RecordSource = "qryContract"
Me.Label22.Caption = "Contracts"
End Select
exitSub:
Exit Sub
ErrHandler:
If Err.Number = 2501 Then 'exitSub
Else
MsgBox Err.Number & vbCrLf & Err.Description
End If
Resume exitSub
End Sub
Private Sub Report_NoData(Cancel As Integer)
MsgBox "No records were found."
Cancel = True
DoCmd.OpenForm "RunQuery"
End Sub
Can anyone tell me why it's not ending the open report function and bailing? It goes back to my form correctly, but of course gives me the error as well. ANy thoughts? Thanks!