Printing Reports Sequentially

mattpfc

Active Member
Joined
Nov 21, 2002
Messages
299
Hi all,

Is it possible to sequentially print page by page from 2 different reports?

At current the user clicks a button and two reports open determined on data on the form, a message box then prompts the user if they wish to print these report details. At current the first report prints entirely and then the second does.

However to save the user time and confusion I woundered if it was possible to print page one of "report a", then page one of "report b", then page 2 of "report a" then page 2 of "report b" etc.

If this is possible a pointer in the right direction would be much appriciated
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
My first thought is this:

Base the reports on a query and change the query before printing.

User selects criteria (data on the form that you mentioned)
Also clicks a checkbox that prints the detail.
Code builds a deletes old query if present, builds new (for each)
Print Report (based on the query you just built) which will be just the first page as you defined it.
If you checked the detail box, you repeat the above steps.
(Delete old query, build new query, print report based on new query)

Mike
 
Upvote 0
This is what I have so far, however I have come to realse that when trying to perform a page count on a report which only spans one page, but a new set of records is the next page this method will not work. :(

I presume this is because the page count is always 1 or 0 and that the records are merged in. Now I'm really stuck.


Code:
Private Sub Sequential_print()

    Dim report1 As String
    Dim report2 As String
    Dim report_page_count As Integer
    
    report1 = "stalls"
    report2 = "stalls2"
        
    DoCmd.OpenReport report1, acPreview
    DoCmd.OpenReport report2, acPreview
     
    report_page_count = Reports(report1).Pages
    
        
    For counter = 1 To report_page_count
    
        DoCmd.SelectObject acReport, report1, True
        DoCmd.PrintOut acPages, counter, counter
        
        DoCmd.SelectObject acReport, report2, True
        DoCmd.PrintOut acPages, counter, counter
        
    Next
    

End Sub
 
Upvote 0
Found this command that I've never used.
It includes a From/To option on which pages to print.

DoCmd.PrintOut

I was wondering, I've never used a subreport before but could it help here?
 
Upvote 0

Forum statistics

Threads
1,221,668
Messages
6,161,163
Members
451,687
Latest member
KENNETH ROGERS

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top