I am using a command button and and option box with values 1 – 5 to view reports in print preview
I added some error code to the “On No data” event to each of the reports.
Private Sub Report_NoData(Cancel As Integer)
MsgBox "No data found! Closing report."
Cancel = True
End Sub
This works, the message appears, I click OK but then I get a runtime error 2501 the open report action was cancelled. When I click on the debug button it brings me to this line of code
Else: DoCmd.OpenReport "rptMemberASLHB", acViewPreview
in this block of code
Case Is = 1
If IsNull([cboHSEID]) Then
MsgBox "Please Select a Health Board Area"
DoCmd.GoToControl "cboHSEID"
cboHSEID.Dropdown
Else: DoCmd.OpenReport "rptMemberASLHB", acViewPreview
End If
Any idea's how to handle no data when the reports are pulled from select statements
I added some error code to the “On No data” event to each of the reports.
Private Sub Report_NoData(Cancel As Integer)
MsgBox "No data found! Closing report."
Cancel = True
End Sub
This works, the message appears, I click OK but then I get a runtime error 2501 the open report action was cancelled. When I click on the debug button it brings me to this line of code
Else: DoCmd.OpenReport "rptMemberASLHB", acViewPreview
in this block of code
Case Is = 1
If IsNull([cboHSEID]) Then
MsgBox "Please Select a Health Board Area"
DoCmd.GoToControl "cboHSEID"
cboHSEID.Dropdown
Else: DoCmd.OpenReport "rptMemberASLHB", acViewPreview
End If
Any idea's how to handle no data when the reports are pulled from select statements