Accessing info on a subreport

B

Brandon

Hello all:

I just have a quick question. I have a report that
contains two seperate subreports in the details section.
I want to access a field on each subreport on the main
report and add the fields. Is there a way to access
values on a subreport in the main report?

I am using Access 2000. Any suggestions would be greatly
appreciated. Thanks in advance.

Brandon
 
M

Marshall Barton

Brandon said:
I just have a quick question. I have a report that
contains two seperate subreports in the details section.
I want to access a field on each subreport on the main
report and add the fields. Is there a way to access
values on a subreport in the main report?

I am using Access 2000.

Use a text box with an expression like:

=IIf(subreport1.Report.HasData, subreport1.Report.text1, 0)

Note that the text1 textbox on subreport 1 should be in the
subreport's footer section (other sections can occur more
than once, so their values are not uniquely defined).

You can add two of those expressions in the detail section
just by using +

=IIf(subreport1. ...) + IIf(subreport2. ...)

If you want to sum those values across all the details, then
use another text box in the detail section that refers to
the same thing and set its RunningSum property to Over All.
Then the main report's footer can have yet another text box
that refers back to the running sum text box.
 
T

Terry

Brandon,

[reports]![mainreportname].[subreportname].[controlname]

Should get the value / contents of the control in the
subreport.

HTH

Terry
 

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