Creating a sub report with variable number of fields to print

M

Michel Khennafi

Good morning

I would like to create a report that includes a subreport.

Situation:

- I have a Table T1
- I created a Xtab query 1 and a Xtab query 2 to extract informations from
the T1 table (sum of a field f1 by day of the week: Sun, Mon, Tue...)
- I created a selection query SQ1 that grabs all the data from Xtab queries
1 and 2 (sum of a field f2 by day of the week)
- Sub report is for data gathered in the selction query SQ1

My problem is that the number of fields returned by SQ1 may vary (1 week i
have totals for Mon thru Fri and another week I could have sums for Mon thru
Sun). I want to create a report that could handle all situations

I could I create a report that handles my problem?

Thanks for any guidance or help

MK
 
A

Allen Browne

Open the crosstab query in design view.
Open the Properties box (View menu.)
Type the days of the week beside the Column Headings property, e.g.:
"Sun";"Mon";"Tue";"W...

You will now get 7 columns shown, even if a particular week does not have
data for all 7 days. Since all 7 columns turn up, you can build your
subreport with the 7 columns, and it won't fail.

More details:
Crosstab query techniques - row totals, zeros, parameters, column
headings
at:
http://allenbrowne.com/ser-67.html
 
M

Michel Khennafi

It works perfectly thanks for the tip

MK
Allen Browne said:
Open the crosstab query in design view.
Open the Properties box (View menu.)
Type the days of the week beside the Column Headings property, e.g.:
"Sun";"Mon";"Tue";"W...

You will now get 7 columns shown, even if a particular week does not have
data for all 7 days. Since all 7 columns turn up, you can build your
subreport with the 7 columns, and it won't fail.

More details:
Crosstab query techniques - row totals, zeros, parameters, column
headings
at:
http://allenbrowne.com/ser-67.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top