O
Outatym
I have a form with a command button. When this button is clicked it runs
code that will run a query and open up a report, call up the print command so
that I can print pdfs, then closes that report out, and then cycles to the
next report for the same actions. On 4 of the reports I need to split the
query's results into 2 separate reports. For example, right now say report
"A" has 4 pages. I am having to manually open up the printed PDF then split
it into report "A1" & "A2".
Is there any way so that Access can split the files inhalf for me while the
code is running so that this last step can be eliminated?
I have pasted my code below so that you can see what is going on:
**********************************************************
Private Sub CMDBUTTON_Click()
On Error GoTo Err_Command4_Click
DoCmd.OpenReport "AL Report", acViewNormal, "", "", acNormal
DoCmd.Close , "AL Report"
DoCmd.OpenReport "AR Report", acViewNormal, "", "", acNormal
DoCmd.Close , "AR Report"
DoCmd.OpenReport "FL Report", acViewNormal, "", "", acNormal
DoCmd.Close , "FL Report"
DoCmd.OpenReport "GA Report", acViewNormal, "", "", acNormal
DoCmd.Close , "GA Report"
DoCmd.OpenReport "IL Report", acViewNormal, "", "", acNormal
DoCmd.Close , "IL Report"
DoCmd.OpenReport "IN Report < 15", acViewNormal, "", "", acNormal
DoCmd.Close , "IN Report < 15"
DoCmd.OpenReport "IN Report > 15", acViewNormal, "", "", acNormal
DoCmd.Close , "IN Report > 15"
DoCmd.OpenReport "KY Report < 15", acViewNormal, "", "", acNormal
DoCmd.Close , "KY Report < 15"
DoCmd.OpenReport "KY Report > 15", acViewNormal, "", "", acNormal
DoCmd.Close , "KY Report > 15"
DoCmd.OpenReport "MO Report", acViewNormal, "", "", acNormal
DoCmd.Close , "MO Report"
DoCmd.OpenReport "MS Report", acViewNormal, "", "", acNormal
DoCmd.Close , "MS Report"
DoCmd.OpenReport "OH Report", acViewNormal, "", "", acNormal
DoCmd.Close , "OH Report"
DoCmd.OpenReport "SC Report", acViewNormal, "", "", acNormal
DoCmd.Close , "SC Report"
DoCmd.OpenReport "TN Report", acViewNormal, "", "", acNormal
DoCmd.Close , "TN Report"
DoCmd.OpenReport "WV Report", acViewNormal, "", "", acNormal
DoCmd.Close , "WV Report"
DoCmd.Close , "PrintReports"
Exit_Command4_Click:
Exit Sub
Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click
End Sub
**********************************************************
Any help would be greatly appreciated!
Thanks!
Chris
code that will run a query and open up a report, call up the print command so
that I can print pdfs, then closes that report out, and then cycles to the
next report for the same actions. On 4 of the reports I need to split the
query's results into 2 separate reports. For example, right now say report
"A" has 4 pages. I am having to manually open up the printed PDF then split
it into report "A1" & "A2".
Is there any way so that Access can split the files inhalf for me while the
code is running so that this last step can be eliminated?
I have pasted my code below so that you can see what is going on:
**********************************************************
Private Sub CMDBUTTON_Click()
On Error GoTo Err_Command4_Click
DoCmd.OpenReport "AL Report", acViewNormal, "", "", acNormal
DoCmd.Close , "AL Report"
DoCmd.OpenReport "AR Report", acViewNormal, "", "", acNormal
DoCmd.Close , "AR Report"
DoCmd.OpenReport "FL Report", acViewNormal, "", "", acNormal
DoCmd.Close , "FL Report"
DoCmd.OpenReport "GA Report", acViewNormal, "", "", acNormal
DoCmd.Close , "GA Report"
DoCmd.OpenReport "IL Report", acViewNormal, "", "", acNormal
DoCmd.Close , "IL Report"
DoCmd.OpenReport "IN Report < 15", acViewNormal, "", "", acNormal
DoCmd.Close , "IN Report < 15"
DoCmd.OpenReport "IN Report > 15", acViewNormal, "", "", acNormal
DoCmd.Close , "IN Report > 15"
DoCmd.OpenReport "KY Report < 15", acViewNormal, "", "", acNormal
DoCmd.Close , "KY Report < 15"
DoCmd.OpenReport "KY Report > 15", acViewNormal, "", "", acNormal
DoCmd.Close , "KY Report > 15"
DoCmd.OpenReport "MO Report", acViewNormal, "", "", acNormal
DoCmd.Close , "MO Report"
DoCmd.OpenReport "MS Report", acViewNormal, "", "", acNormal
DoCmd.Close , "MS Report"
DoCmd.OpenReport "OH Report", acViewNormal, "", "", acNormal
DoCmd.Close , "OH Report"
DoCmd.OpenReport "SC Report", acViewNormal, "", "", acNormal
DoCmd.Close , "SC Report"
DoCmd.OpenReport "TN Report", acViewNormal, "", "", acNormal
DoCmd.Close , "TN Report"
DoCmd.OpenReport "WV Report", acViewNormal, "", "", acNormal
DoCmd.Close , "WV Report"
DoCmd.Close , "PrintReports"
Exit_Command4_Click:
Exit Sub
Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click
End Sub
**********************************************************
Any help would be greatly appreciated!
Thanks!
Chris