Hi -
I have a button that runs 2 reports. If there is no data on the
report, I use the No Data event, and tell the user, and Cancel the
execution of that report.
However, if the first report has no data, the second report doesn't
run. All execution stops.
Is there a way in VBA to go on to the next report after the No Data?
thanks -
Sara
(Code Below)
Case Is = 8
strDocName = "rptEstFreight0ActualNOT0"
strStepErrorMsg = "Tell IT there was a problem with Request
Est 0 Actual Not"
strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile
DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile
strDocName = "rptImpactofFreightChanges-Range"
strStepErrorMsg = "Tell IT there was a problem with Request
Impact Freight Change by dates"
strFile = strDocName & ".snp"
strPathAndFile = strPath & strFile
DoCmd.OutputTo acOutputReport, strDocName, "snapshot format",
_
strPathAndFile
Report No Data:
Private Sub Report_NoData(Cancel As Integer)
Dim WeekEndDate As Date
Dim WeekStartDate As Date
WeekStartDate = [Forms]![frmPrintPOReports]![getSaleDate]
WeekEndDate = [Forms]![frmPrintPOReports]![getWkMoDate]
'Tell the user there is no data
MsgBox "There are no POs for the Period Between " & _
WeekStartDate & " And " & WeekEndDate & _
" With Estimated Freight 0 and Actual Freight on file"
Cancel = True
End Sub