I have a report which I want to print when its preceeding report has no data.
I used the following code but nothing happens. Can someone point this newbee in the right direction???
Option Compare Database
Option Explicit
Private Sub Report_NoData(Cancel As Integer)
Dim Nodata1 As Access.Report
Dim strReportName As String
MsgBox "There is no data for this report."
Cancel = -1
strReportName = "Nodata1"
DoCmd.PrintOut.Nodata1
End Sub

I used the following code but nothing happens. Can someone point this newbee in the right direction???
Option Compare Database
Option Explicit
Private Sub Report_NoData(Cancel As Integer)
Dim Nodata1 As Access.Report
Dim strReportName As String
MsgBox "There is no data for this report."
Cancel = -1
strReportName = "Nodata1"
DoCmd.PrintOut.Nodata1
End Sub