Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there limit to number of reports that can be previewed

Status
Not open for further replies.

EddyLLC

Technical User
Mar 15, 2005
304
US
I have a text file the data from which I create 4 different reports. I have code that opens these reports in preview mode. My question, Is there a limit to the number of preview screens you can open at once. The code runs without an error but when I look at the 2 preview screens open only the first pair are there. Is it possible to open more than 2 preview screens at once?

Thanks
 
Hi EddyLLC
I replied in:
Page numbering continued from 1st report to 2nd report
thread705-1273164
 
n the Report's Code Module, after the Option Explicit Statement, copy and paste the following text:

Public rKey As String

I found some code in Thread703-789560 that looks like it could solve my problem of printing multiple instances of a single report. It involves adding the following to the report module:

Public rKey as string
Private Sub Report_Close()
rCol.Remove rKey
End Sub

Then adding a separate Module, with the following code:
'''''Begin Code'''''
Public rCol As Collection, rTemp As Report
' rCol is the collection of open instances of the report
' rTemp is the temporary Report type used to add each instance to the Collection

Public Sub rpt_Multi()
"Code that produces the report"

DoCmd.OpenReport "Report1", acViewPreview
Set rTemp = New Report_Report1
rTemp.hKey = CStr(rTemp.hwnd)
rTemp.Visible = True
rCol.Add rTemp, rTemp.hKey
DoEvents

I worked this code into mine as suggested but when run I receive an "Invalid Procedure or Argument" error on the Report_Close event of the first instanc of the report.

Can anybody give me a hint as to why this is occuring?
Thanks for any help.
Eddy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top