Re: trouble with SUM function - Repost



Thanks for your reply Marshall! I was able to get it to work in the
ProjectName Footer with the following Control Source: =Sum(
[LineTotalSellPrice])+[txtRunUseTax]+[txtRunSalesTax]
I named this control txtProjectTotal.

In the interest of compacting the report a bit, my hope was to have this
total show in the ProjectName Header, so I added a control in that and
entered the following Control Source: =txtProjectTotal

Doing that not only gave me an incorrect total in that added control, but the
control in the footer actually changed to the incorrect value also.
Incidently, it only added the sum of the "Tax" controls from the first record
in the BidNumber group. Seems strange, but I'm wondering if you have any
thoughts as to why that would occur. I can certainly live with the total in
the footer.

Also, do you know if it's possible to sort the report in descending order by
the values it generates in the control txtProjectTotal?

Thanks again!
Slez


Marshall Barton wrote:
OOPS!...Hit something as I was typing that made it post...Here is the
"complete" post!
[quoted text clipped - 22 lines]
All of these have failed to work. In the first 2 cases, it prompts me for
BidTotal when I run the report.

The aggregate functions only operate on **fields** in the
report's record source table/query. They are unaware of
**controls** in the report.

To total a control (named txtA) in a group header/footer,
you can add a text box (named txtRunA) next to txtA. Set
txtRunA control source property to =txtA and its RunningSum
property to Over Group.

Then the next higher leverl group footer can display the
total in a text box with the expression =txtRunA

In your case a ProjectNameTotal text box would have an
expression like:
=Sum([LineTotalSellPrice])+txtRunSalesTaxAmount+txtRunUseTaxAmount


--
Message posted via http://www.accessmonster.com

.



Relevant Pages

  • Re: Conditional Macros help
    ... as the control source for the footer section text box ... >> But after reading how to create Macros and Condintional ...
    (microsoft.public.access.macros)
  • Re: Subform Totals
    ... incompatible with an expression inside a control. ... For each of these fields their is a total field in the form footer. ... form footer of the subform or about the form footer of the main form. ... The questions is why do the total fields in the form footer of the sub ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Subform Totals
    ... Maybe some confusion between a control and its bound field if both are using ... For each of these fields their is a total field in the form footer. ... form footer of the subform or about the form footer of the main form. ... The questions is why do the total fields in the form footer of the sub ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Sum Field in Subform
    ... you cannot sum a calculated control like that. ... > subform footer bar). ... >>> (hand coded, using the Expression Builder, etc.) but it continues to ...
    (microsoft.public.access.forms)
  • Re: footer appearing when it shouldnt in Microsoft Access Reports
    ... The only control in the footer is the Image control to display the flow ... The first few records of my report have null values in the FlowChartPg1 ... If I can't figure out what is causing the Format or Print event to ...
    (microsoft.public.access.reports)

Loading