Run on Reports

V

Very Basic User

Hello,

I have a reoprt with multiple sub level reports that are all filtered by
catagory. When I open the report it takes a long time for the program to stop
"Thinking" I can't work with it for a while. I found that if I scroll down,
it restarts the report 14 times and tries to print the same. Is there an easy
reason that it's trying to open the same report multiple times?
 
D

Danny Lesandrini

John:

I'm assuming that the table behind the report is large and that the sub
level reports are linked (Child/Master) on some key column, right?

If the report opens to a single filtered record, like a CompanyID, then you
might try prefiltering the report and subreport recordsets. I do this by
using a pair of public functions, in a public module, to SET and GET the ID
value.

' Put this in a public module
Private m_lngCompanyID As Long

Public Function SetCompanyID(ByVal lngValue) As Boolean
m_lngCompanyID = lngValue
End Function
Public Function GetCompanyID() As Long
GetCompanyID = m_lngCompanyID
End Function


' Add this to the code that launches the report
Call SetCompanyID(Me!txtCompanyID)
DoCmd.OpenReport "rptCompanyReport"

' Use this in the WHERE clause of the Report and Subreports ...
SELECT * FROM qryReport WHERE CompanyID = GetCompanyID()


I'm not sure that this will solve your issue, but it will minimize the data
that the report needs to manage. Worth a shot.
 

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

Top