linanderson
Registered User.
- Local time
- Today, 22:26
- Joined
- Jul 13, 2002
- Messages
- 17
I have a report dialogue form where users can select a report to run (frmRptDialog).
However I am having some errors when there is no data for a given report and the preview of the report is cancelled.
The code on a given report is:
The debug opens up the following as an error:
I am trying to identify where the code needs to change. I do want frmRptDialog to close when a report is opened and open again when a report is closed and I wonder if the code is wrong here in the situation where there is no data.
Any quidance would be helpful.
Thanks
However I am having some errors when there is no data for a given report and the preview of the report is cancelled.
The code on a given report is:
Private Sub Report_NoData(Cancel As Integer)
MsgBox "There is no data for this report. Cancelling report..."
Cancel = -1
DoCmd.OpenForm "frmRptDialog"
End Sub
Private Sub Report_Close()
DoCmd.Close acForm, "frmReportDateRange"
DoCmd.OpenForm "frmRptDialog"
End Sub
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "frmReportDateRange", , , , , acDialog, "rptSalesAnalysisByEPCandAgentPD"
If Not IsLoaded("frmReportDateRange") Then
Cancel = True
End If
DoCmd.Close acForm, "frmRptDialog"
End Sub
MsgBox "There is no data for this report. Cancelling report..."
Cancel = -1
DoCmd.OpenForm "frmRptDialog"
End Sub
Private Sub Report_Close()
DoCmd.Close acForm, "frmReportDateRange"
DoCmd.OpenForm "frmRptDialog"
End Sub
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "frmReportDateRange", , , , , acDialog, "rptSalesAnalysisByEPCandAgentPD"
If Not IsLoaded("frmReportDateRange") Then
Cancel = True
End If
DoCmd.Close acForm, "frmRptDialog"
End Sub
The debug opens up the following as an error:
Private Sub ReportID_DblClick(pintCancel As Integer)
RunReport acViewPreview
End Sub
Private Sub RunReport(pintRptView As Integer)
DoCmd.OpenReport Me.ReportID, pintRptView
End Sub
RunReport acViewPreview
End Sub
Private Sub RunReport(pintRptView As Integer)
DoCmd.OpenReport Me.ReportID, pintRptView
End Sub
I am trying to identify where the code needs to change. I do want frmRptDialog to close when a report is opened and open again when a report is closed and I wonder if the code is wrong here in the situation where there is no data.
Any quidance would be helpful.
Thanks