Displaying controls from different queries

  • Thread starter Thread starter Piers Chivers
  • Start date Start date
P

Piers Chivers

Hi,
This is a very simple question that I just can't figure out.

How do I display controls from different queries onto the same report?

My problem is that I have a table for an entertainment event that includes
fields:
OrderID
TypeOfTravel - either "Walking" or "Driving"
NumberOfAdults
NumberOfChildren

I need to show the total number of walking adults and total number of
driving adults. I can easily compute these values in separate queries but
how do I show them on the same report? Maybe there's a way to compute them
in the same query? Any input gratefully received.

Many thanks,
Piers
 
You can add a text box to your report footer with a control source like:
=Sum(Abs([TypeOfTravel]="Walking") * [NumberOfAdults])
 
Hi Duane,
Thanks for the answer. This seems to work!!

However, I don't understand the use of Abs. Are you expecting this to
return 1 if [TypeOfTravel]="Walking" and 0 otherwise? The help page doesn't
suggest this is the case.

Also, on a general point, how do I display results from two separate queries
on the same form?

Piers

Duane Hookom said:
You can add a text box to your report footer with a control source like:
=Sum(Abs([TypeOfTravel]="Walking") * [NumberOfAdults])

--
Duane Hookom
MS Access MVP
--

Piers Chivers said:
Hi,
This is a very simple question that I just can't figure out.

How do I display controls from different queries onto the same report?

My problem is that I have a table for an entertainment event that
includes fields:
OrderID
TypeOfTravel - either "Walking" or "Driving"
NumberOfAdults
NumberOfChildren

I need to show the total number of walking adults and total number of
driving adults. I can easily compute these values in separate queries but
how do I show them on the same report? Maybe there's a way to compute
them in the same query? Any input gratefully received.

Many thanks,
Piers
 
Abs() returns the absolute value of an expression. A true value becomes 1.

You can use two separate queries by creating subreports.

--
Duane Hookom
MS Access MVP


Piers Chivers said:
Hi Duane,
Thanks for the answer. This seems to work!!

However, I don't understand the use of Abs. Are you expecting this to
return 1 if [TypeOfTravel]="Walking" and 0 otherwise? The help page
doesn't suggest this is the case.

Also, on a general point, how do I display results from two separate
queries on the same form?

Piers

Duane Hookom said:
You can add a text box to your report footer with a control source like:
=Sum(Abs([TypeOfTravel]="Walking") * [NumberOfAdults])

--
Duane Hookom
MS Access MVP
--

Piers Chivers said:
Hi,
This is a very simple question that I just can't figure out.

How do I display controls from different queries onto the same report?

My problem is that I have a table for an entertainment event that
includes fields:
OrderID
TypeOfTravel - either "Walking" or "Driving"
NumberOfAdults
NumberOfChildren

I need to show the total number of walking adults and total number of
driving adults. I can easily compute these values in separate queries
but how do I show them on the same report? Maybe there's a way to
compute them in the same query? Any input gratefully received.

Many thanks,
Piers
 
Back
Top