How to reference individual records from multiple subreports

G

Guest

I have 3 subreports within my main report, each with a field containing 10
records. I want to add the first row (first record) of each of the 3
subreports, but do not know how to reference this.

If I create a textbox and have the data source as
=Reports![MainReport]![SubReport]![FieldName].Value it is fine to display the
first value (first record's value). But I cannot find how to then display
the second records value. How do I identify the second row (or second record)
individually so as to add all the second values from all 3 subreports, or is
this impossible to do?
 
A

Allen Browne

If I understand you correctly, it will be easiest to add another subreport
to give you the analysis correctly.

I think you have something like this. The main report has a list of all your
stores, and the subreport has the sales at each store, e.g.:
New York
Apples 100
Bananas 50
Total: 150
Bostin
Apples 70
Bananas 20
Total: 90
Then at the end of the report you want to show totals grouped by product:
Apples 170
Bananas 70

If that's what you are doing, just make another subreport for the summary by
product. Put this subreport into the Report Footer section.

Reports are different to forms. With a report you can read the value of a
text box only while that section is being formatted or printed. Once the
report moves on, that value is no longer available. That means you cannot
use a reference like
Report!MyReport!MyTextbox
reliably, except in the Format or Print event of the section tat contains
MyTextbox.
 

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