Report Preview

Franknstuff

More I know Less I know
Local time
Today, 05:12
Joined
Apr 28, 2004
Messages
54
I have a multi select box that the operator selects multiple products and several reports are generated. When I don't use the acViewPreview everything works fine. However, they want to preview each report selected.
The problem is that Axcess is only allowing me to preview the first report even though the "Products Query " is updated as it goes. Is there a way to Preview the report then go to the next report automatically.


I'm using : DoCmd.OpenReport "Products Query", acViewPreview and updating the Products Query based on there selections with a For Next Loop.

Why is it always the little things?
 
Basically, then, you need to be able to preview multiple instances of the report Products Query with different recordsets? No problem.

Open the report Products Query in design view. In the reports Code Module, paste the following line after the Option Explicit statement:
Code:
Public rpt As [Report_Products Query]

Save the report.

Now, instead of:
Code:
DoCmd.OpenReport "Products Query", acViewPreview

...use the following sub:
Code:
Public Sub rptOpen()

Dim rpt As Report

    Set rpt = New [Report_Products Query]
    rpt.Visible = True
    Set rpt.rpt = rpt
    Set rpt = Nothing
    DoEvents

End Sub

Now, all you have to do each time you update the Products Query is call the function with:
Call rptOpen
 
Nice

"Wow", what effort just to open multiple Report previews. It works great!!!!!
Thanks.
 

Users who are viewing this thread

Back
Top Bottom