Total the Value of Two Fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report that includes the fields FeeCollected and PenaltyCollected.
In the Report Footer I’ve added two calculated controls with one control
source set to =Sum([FeeCollected]) and the other to =Sum([PenaltyCollected])
to total the values in the fields. I’ve added another calculated control to
give a grand total of FeeCollected and PenaltyCollected, but it is not
totaling properly. I’m using =Sum([AdminFineCollected]+[TaxFineCollected]).
What should I be doing differently to get this to work?
 
If you already have the 2 totals in text boxes named (say) Textbox1 and
Textbox2, just set the ControlSource to:
=[Textbox1] + [Textbox2]

That won't work correctly if either one is null, so better to use:
=Nz([Textbox1],0) + Nz([Textbox2],0)

Set the Format property of all 3 text boxes to Currency (or General Number
if you prefer) so that Access treats them as numeric values.
 
hi,
try add the query name to the calculations.
=Sum([query1]![AdminFineCollected]+[query1]!
[TaxFineCollected]).
 
That did it. Thank you Allen!!

Allen Browne said:
If you already have the 2 totals in text boxes named (say) Textbox1 and
Textbox2, just set the ControlSource to:
=[Textbox1] + [Textbox2]

That won't work correctly if either one is null, so better to use:
=Nz([Textbox1],0) + Nz([Textbox2],0)

Set the Format property of all 3 text boxes to Currency (or General Number
if you prefer) so that Access treats them as numeric values.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Katherine R said:
I have a report that includes the fields FeeCollected and PenaltyCollected.
In the Report Footer I've added two calculated controls with one control
source set to =Sum([FeeCollected]) and the other to
=Sum([PenaltyCollected])
to total the values in the fields. I've added another calculated control
to
give a grand total of FeeCollected and PenaltyCollected, but it is not
totaling properly. I'm using
=Sum([AdminFineCollected]+[TaxFineCollected]).
What should I be doing differently to get this to work?
 

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

Back
Top