1x Report 2x Queries

manix

Registered User.
Local time
Today, 16:46
Joined
Nov 29, 2006
Messages
100
Hi all,

I have one report that I want the data source to be 2x queries. But I only want it to use "one query or the other" depending on which button is pressed on a form, to open the report.

I have tried searching for this solution everywhere, but all I can find is how to create multiple querys to populate a report. I just want one.

Basically it is just using the report as a template but using differing queries to populate it.

TIA
 
Are the queries actually really radically different or are they just different in the criteria of what they are displaying?
 
Are the queries actually really radically different or are they just different in the criteria of what they are displaying?

To be honest it is the criteria that is different:

I have a button that you simply press to pull up current year records. This will obviously be a common occurence, probably on a daily basis.

The other button brings up the same report, but for a past year, that actually is stipulated in an unbound text field!

I can see there is probably some code I could use whereby the same button does both, but my VB is terrible! I.e. if the txt field is blank, always show current year, if not blank, use the year entered in the text box :confused: I wanted to avoid people having to enter the current year each time they use the form!
 
If it is the criteria that is different, you can assign a generic query (one with all of the fields but no criteria) to the report. Then you can open it with something like this with the button by putting, say an option to select either by combo box or an option group,

Actually, download this sample of mine, from my website, to see how you can open the same report but with different criteria as selected:

http://downloads.btabdevelopment.com/Samples/combos/FormSampleFromMultipleCriteria.zip
 
Thanks Bob,

I will check it out and let you know how I get on.
 

Users who are viewing this thread

Back
Top Bottom