multiple instance of report in access

Oct 5, 2011
Reaction score
Hi All,
it is been a while i am struggling with this issue.
i have a main report which holds a subreport.i also need to run multiple instance of main report at the same time . each time sureport runs a separate query as this:

subreport OnOpen()
Static intCallCount As Long
If intCallCount = 0 Then
Me.RecordSource = "sqlquery"
intCallCount = intCallCount + 1
End If

and here is my module to open multiple intance of report: As String)

'Purpose: Open an independent instance of Report
' Static rpt As Report
' Set rpt = New Report_Report1---> this is my main report
' DoEvents
' rpt.Visible = True
' rpt.CurrentView = 1
' rpt.Caption = [Forms]![F_Client]![Client Name]
' clnClient.Add Item:=rpt, Key:=CStr(rpt.Hwnd)
' Set rpt = Nothing

where the clnClientis a public collection variable.

Now here is the problem. as soon as progrom runs
set rpt=New Report_Report_1

it gives me this error on OnOpen event of subreport
"you can't set the recordsource property in print preview or after prnting"

i really dont know what is going on here. appreciate if you can give it a thought

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question