Change Report Datasource on the Fly

geko

Registered User.
Local time
Today, 19:22
Joined
Jun 6, 2003
Messages
33
Afternoon all,

Is it possible to change the datasource of a report on the fly?

If so, how can I do this?

The only problem that I can forsee is that there is a chart on the report that is based on a slightly different (but related) query to the report data, and so would also need changing on the fly.

Thanks in advance for any help you can offer.
 
Can you simply set (or re-set), the record source property of the report in the on open event of the report?

kh
 
Possibly, perhaps a further bit of information is in order.

The db I am working on which casued me to ask this question (although the outcome may well prove useful elsewhere as it always seems to) is one that has been designed to log energy invoices as a way of monitoring energy, although the financial info. is stored, it is more about the consumption of energy.

The company I work for owns several properties, ranging from Leisure Centres to Public Loos.

What I am trying to do is produce a report for each "property type", except for 3 instances where they have been grouped together as "Key Sites" - but it is necessary for other reasons to keep their individual "property types".

At the moment, I have a qry based on an initial qry for the report data source. So that is 2 qrys per report, there are 4 property types, and 4 different types of energy, so that works out to be a fair few qrys and reports. not to mention that there is a qry for each chart on each rpt.

Basically I just want to cut down on the amount of DB objects by changing the data source on the fly.
 

Users who are viewing this thread

Back
Top Bottom