Populating Report w/ Multiple Query's

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report designed up that I would like to have differect query's
populate the same report. What I have to do now is copy the report and then
chagne which query popluates it. This is a problem when you have 20 querys,
therefore 20 reports that all look the same, then a change is needs to be
make to 20 reprots vs just 1. The querys would be run one at a time, with no
2 query active at the same time, so there is no concern from that stand
point.
 
When you open your report using a command button or some other method
you can set the Record Source like this:

DoCmd.OpenReport "YourReportName"
Reports!YourReportName.RecordSource = "YourQueryName"

But if your reports look the same but just have different criteria, you
can use one query and set a filter when you open the report.

Docmd.OpenReport "YourReportName", acViewPreview, ,"YourCriteriaHere"

Hope that helps!
 
jutlaux said:
I have a report designed up that I would like to have differect query's
populate the same report. What I have to do now is copy the report and then
chagne which query popluates it. This is a problem when you have 20 querys,
therefore 20 reports that all look the same, then a change is needs to be
make to 20 reprots vs just 1. The querys would be run one at a time, with no
2 query active at the same time, so there is no concern from that stand
point.


There is probably no need for all those queries. Please
explain what is different from one query to another.

If all you are doing is changing the criteria (i.e. the
Where clause), then this is better handled by using the
OpenReport method's WhereCondition argument. If you have no
idea what I'm talking about, then please explain why you are
not using a form button to run the report.
 
Back
Top