Combine two queries into one (1 Viewer)

HillTJ

To train a dog, first know more than the dog..
Local time
Today, 12:43
Joined
Apr 1, 2019
Messages
712
Hi, i have a report with two subreports. Both linked to the main report by a common id. One subreport summarises products, their pricing etc with a query. The other summarises accessories also with a query. The calcs behind each query are different & the queries have different fields (but there are common fields that i need to reproduce in my quote). I'd like to join both queries into a single query so that the main report displays records from 1 consolidated query. The number of records in each table varies. I tried a make table query which sounds promising, but am unsure how to configure it. Any ideas would be appreciated.
 
Last edited:

June7

AWF VIP
Local time
Today, 15:43
Joined
Mar 9, 2014
Messages
5,423
Queries can be joined to tables or other queries. But the result may not be editable. Why would you want this for form?

If you meant to say you want to combine for a report, that is different matter.
 
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Today, 16:43
Joined
Oct 29, 2018
Messages
21,358
Hi. Not sure I follow. What’s wrong with using subforms? Sounds like you’re trying to eliminate them, why? If I may ask...
 

HillTJ

To train a dog, first know more than the dog..
Local time
Today, 12:43
Joined
Apr 1, 2019
Messages
712
Youre correct. I meant to say report
 

June7

AWF VIP
Local time
Today, 15:43
Joined
Mar 9, 2014
Messages
5,423
Report design depends on data structure and how you want to manipulate data for presentation. Subreports may still be needed.
 

HillTJ

To train a dog, first know more than the dog..
Local time
Today, 12:43
Joined
Apr 1, 2019
Messages
712
I'll try again. I have a report that includes 2 subreports that were included by dragging the queries to the report. Works fine, but i would like the subreports to show as one consolidated sub report rather than separate reports. As there are instances wherre there are no records in thed sub form. How cam this be achirved?
 

HillTJ

To train a dog, first know more than the dog..
Local time
Today, 12:43
Joined
Apr 1, 2019
Messages
712
Hi, just found out that with a snippet of code i can enable/disable a sub datasheet based upon presence/absence of records in a subreport. This should work for me. Anyone got any experience with this?
 

HillTJ

To train a dog, first know more than the dog..
Local time
Today, 12:43
Joined
Apr 1, 2019
Messages
712
Hi, found out about Union queries. I'm now able to combine 2 queries into 1 exactly as i wish. I knew there was a way.
 

June7

AWF VIP
Local time
Today, 15:43
Joined
Mar 9, 2014
Messages
5,423
Ooops, question was about report and I translated in my mind to form. Glad you found solution.
 

HillTJ

To train a dog, first know more than the dog..
Local time
Today, 12:43
Joined
Apr 1, 2019
Messages
712
You know, the hardest part in solving a problem is knowing the right question to ask!! I am indebted to all whom have been patient with a newby.
 

June7

AWF VIP
Local time
Today, 15:43
Joined
Mar 9, 2014
Messages
5,423
Oh, you edited OP to say report instead of form. So my question was valid. Often, providing example data and mockup of desired output can be helpful as well.
 

Users who are viewing this thread

Top Bottom