Hi, I wasn't sure whether this is a form issue or a report issue so hope this is the correct forum.
I use a form to list a lot of my reports and then when I want to preview a report I have a button with the following code
In the on NoData event of the reports I have
Everything works fine except that when there is no data and the OK is clicked then I would like to return to the form frmPrintRpts and I am not sure how to do that. Can anyone tell me how to do this please.
Thank you
I use a form to list a lot of my reports and then when I want to preview a report I have a button with the following code
Code:
Private Sub CmdPreviewReport_Click()
On Error Resume Next
Select Case Me.ReportName
Case "rpt25-NutrientBalance"
DoCmd.OpenForm "frmSlt4RptNutrientBalance"
If Err = 2501 Then Err.Clear
Case Else
DoCmd.OpenReport Me.[ReportName], acViewPreview
End Select
DoCmd.Close acForm, "frmPrintRpts"
If Err = 2501 Then Err.Clear
End Sub
In the on NoData event of the reports I have
Code:
Private Sub Report_NoData(Cancel As Integer)
MsgBox "There are currently no records available for this report."
Cancel = True
End Sub
Everything works fine except that when there is no data and the OK is clicked then I would like to return to the form frmPrintRpts and I am not sure how to do that. Can anyone tell me how to do this please.
Thank you