kaveman
Registered User.
- Local time
- Today, 14:48
- Joined
- May 12, 2004
- Messages
- 58
Hello,
I have a button on a form that I am using to print multiple reports at one time, each report is used to summarize department invoices for a specified date range. Here is the code I am using to print the reports:
Private Sub cmdFK_Click()
On Error GoTo Err_cmdFK_Click
Dim stDocName As String
stDocName = "Invoice_Dept001_sub"
DoCmd.OpenReport stDocName, acNormal
stDocName = "Invoice_Dept002_sub"
DoCmd.OpenReport stDocName, acNormal
stDocName = "Invoice_Dept003_sub"
DoCmd.OpenReport stDocName, acNormal
Exit_cmdFK_Click:
Exit Sub
Err_cmdFK_Click:
MsgBox Err.DESCRIPTION
Resume Exit_cmdFK_Click
End Sub
My issue occurs when one of the reports has no data. For instance if the report 'Invoice_Dept002_sub' has no data an error message pops up and terminates the entire process.
Is there some changes I can make to this code where if one of the reports has no data that report is skipped and the process moves on to printing the next report?
I have a button on a form that I am using to print multiple reports at one time, each report is used to summarize department invoices for a specified date range. Here is the code I am using to print the reports:
Private Sub cmdFK_Click()
On Error GoTo Err_cmdFK_Click
Dim stDocName As String
stDocName = "Invoice_Dept001_sub"
DoCmd.OpenReport stDocName, acNormal
stDocName = "Invoice_Dept002_sub"
DoCmd.OpenReport stDocName, acNormal
stDocName = "Invoice_Dept003_sub"
DoCmd.OpenReport stDocName, acNormal
Exit_cmdFK_Click:
Exit Sub
Err_cmdFK_Click:
MsgBox Err.DESCRIPTION
Resume Exit_cmdFK_Click
End Sub
My issue occurs when one of the reports has no data. For instance if the report 'Invoice_Dept002_sub' has no data an error message pops up and terminates the entire process.
Is there some changes I can make to this code where if one of the reports has no data that report is skipped and the process moves on to printing the next report?