subreport's total to report

G

Guest

I have reviewed prior post, have tried to follow, but no luck.

I wish to have a runing sum of a subreport field available for use on the
parent report.
On the parent report I have this text box:
=IIf(NeedGotOptions.Report!HasData,Nz(NeedGotOptions.Report!Need),0) The
running sum property is set to over all.

Data will appear on the parent form in this text box, but the data is not a
total of all subreports fields, only the first detail,

How do you total all of the records in the subreport, then use this total on
the parent report for additional caulculations.
 
A

Allen Browne

You say the control in the subreport is using a running sum, so this is
probably a timing issue, i.e. the main report is reading the value from the
subreport before all values have been accumulated.

To solve that, add a Report Footer section to your subreport (View menu, in
report design view.) In this section, add a new text box with these
properties:
Name txtSubtotal
Control Source =[Need]
Format Currency

Now change the Control Source of the text box on the main report to:
=IIf(NeedGotOptions.Report.HasData,Nz(NeedGotOptions.Report!txtSubtotal),0)

The subreport should now assign the value to the box in the group footer at
the right time, and the main report should read that correctly. Once you
have it working, you can set the Visible property of the subreport's Report
Footer section to No if you wish.
 

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