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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using query for recordsource in subreport

Status
Not open for further replies.

weckels

MIS
May 9, 2002
26
US
I have a subreport that "runs" about 50 times in a report. It is in a group footer. The source for this subreport is a query. The report/subreport works fine except that it runs very slowly since the subreport makes the query run 50 times. Is there a way to have this query be the source of a subform and then reference the subform as the recordsource for the subreport? That way the query should have to run only 1 time. (In theory, I guess). I have tried to do this but without success. Maybe there is another angle that this problem can be attacked from. Any thoughts?
Thanks for any help.

Will
 
Does the where clause in the subreport query use only indexed fields? Paste in the SQL and identify fields used in the selection that may not be indexed.
 
The fields are indexed but the problem is not that the query runs slow. It runs pretty quickly. The slowness comes from the query having to run 50 times. I am looking for a way that makes the query run only 1 time. That's why I thought that I could put a subform on my main form that has the query as its source and then I could use the subform data to be the recordsource of my subreport.
Thanks,

Will
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top