Two reports replaced by one with switchable queries?

vwgolfman

Registered User.
Local time
Today, 09:03
Joined
May 26, 2008
Messages
35
Hi,
I was wondering if anybody can offer some help and advice on the following please?............

I have 2 reports.
They both display identical fields.

The difference between the two being the queries behind them (each report has its own 'integrated' query sitting directly behind the report as the record source if that makes sense).
One query summarises the values for each field.
The other query simply displays the stored values.

I am wondering whether I could replace my above method with a SINGLE report and then somehow tell it which query to use (using VBA or otherwise)?

Thank you.
 
Last edited:
You can set the source of the report in its open event, so yes you can use just one report. You may even be able to use one query. I've got reports that display detail records and then summarizes them in footers. I give the users the option to just view the summarized info by having them check a checkbox, then I test that checkbox in the report's open event and hide the detail section if checked.
 
Last edited:
The simple thing to do is set the recordsource of the report when the report opens to which ever query you want.
 
Fastest fingers in the west! :p
 
Hey guys,

Thanks for your advice.

At the moment my reports' record source is an "integrated" report query.
Does this make sense?
What's the proper name for this type of query?

I presume to do the new business I shall have to create my query/queries as "standalone" queries (so I can refer the report to them)?

Am I on the right lines LOL?

Also I think there may be some problems in doing what I want because the Control Source changes in the property sheet too.
i.e. the field "NumberOfClients" changes to "SumOfNumberOfClients" once I have applied my SUM function to the field.

The SELECT clause changes between the two queries from...
SELECT tblCommonData.NumberOfClients
to
SELECT Sum(tblCommonData.NumberOfClients) AS SumOfNumberOfClients

In the latter the Control Source changes for the bound textbox on the report.

Am I talking sense here?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom