Sum of Group Footer

D

DS

I'm trying to get the sum of a records in a group footer. This is the
expression that I have in the footer:
=IIf([Text55]=True,[Text53]*[SalesTax]+[Text53],[Text53])

This is the expression that I have on the page footer...
=Sum(IIf([Text55]=True,[Text53]*[SalesTax]+[Text53],[Text53]))

I keep getting an ERROR message. How can I fix this?
Thanks
DS
 
M

Marshall Barton

DS said:
I'm trying to get the sum of a records in a group footer. This is the
expression that I have in the footer:
=IIf([Text55]=True,[Text53]*[SalesTax]+[Text53],[Text53])

This is the expression that I have on the page footer...
=Sum(IIf([Text55]=True,[Text53]*[SalesTax]+[Text53],[Text53]))

I keep getting an ERROR message. How can I fix this?


Couple of issues here.

First, Sum can not be used in a Page Header/Footer section.
Sum works in all levels of Group Headers/Footers and in the
Report Header/Footer, depending on the range of records you
want to total.

Second, Sum, like all of the aggregate functions only
operates on fields in the form/report record source
table/query. It is unaware of controls on the form/report.

Since your Subject line says group footer, I'll assume
that's what you want. Then to sum the the calculated
values, you need to expand the expression to use only the
bound fields insetad of controls. E.g.
=Sum(IIf([fldA]=True,[fldB]*[SalesTax]+[fldB],[fldB]))

If that get to be too complex, you should look into using a
text box with its RunningSum property set to Over Group.
 

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