subreport totals

A

AUDREY @ SIG

i have two subreprts in one report. the first subreport is called subreport
managed account performance and the total field is called total open amount.
the second subreport is called subreport partnership report and the total
field in this subreport is called total addition. i am trying
(unscuccessfully) to put on the main report a grand total of "total open
amount" and "tot addition". help - all i try is not working.
thanks in advance.
 
M

Marshall Barton

AUDREY @ SIG said:
i have two subreprts in one report. the first subreport is called subreport
managed account performance and the total field is called total open amount.
the second subreport is called subreport partnership report and the total
field in this subreport is called total addition. i am trying
(unscuccessfully) to put on the main report a grand total of "total open
amount" and "tot addition". help - all i try is not working.


Note that the names of the report objects used as subreports
is irrelevant. What is important are the names of the
subform **controls** that contain the report objects. YOu
can determine these names by double clicking on the
subreport control's border and looking at the control's Name
property. (The name of the report object will be in the
SourceObject property.)

If the subreports will always have at least one record, then
the subreports will have a total and the main report text
box can display the total using an expression like:

=subreportcontrol1.Report.[total open amount] +
subreportcontrol2.Report.[tot addition]

If either subreport mught not have any records, then there
will be no total and the above will display #Error. The
expression in this situation would be:

=IIf(subreportcontrol1.Report.HasData,
subreportcontrol1.Report.[total open amount], 0) +
IIf(subreportcontrol2.Report.HasData,
subreportcontrol2.Report.[tot addition], 0)

I recommend that you break yourself of the habit of using
blanks or other nonalphanumeric characters in any names you
create. A common way to name your total text boxes is
TotalOpenAmount and TotAddition. This eliminates the
requirement for the [ ] around the names.
 

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