Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

=SUM Calculation on Report 1

Status
Not open for further replies.
Sep 12, 2006
111
US
Version: Access 2007

I have a text box (txtTotalCost) with the following control source: =([SumOfQuantity]*[ProductPrice]) on a report

However, I want to calculate the total sum for all these text box values but I get the #Error.

I created a new text box (txtSumTotalCost) and entered the following for the control source:

=Sum([SumOfQuantity]*[ProductPrice])

Also tried the following with the same results.

=Sum([txtTotalCost])

Is it true that access can not calulate a based on text box name when that text box already has an expression?
 
In which report section is txtTotalCost?

In which report section is txtSumTotalCost?

Are SumOfQuantity and ProductPrice both numeric type fields in your report's record source?

You can't Sum() a control. You can Sum() an expression based on fields.

You can't Sum() anything in the Page sections of your report.

You can Sum() in report header and footer, group headers and footers, and the detail section.

Duane
Hook'D on Access
MS Access MVP
 
txtTotalCost is located in in a group header which also contain the SumOfQuantity and ProductPrice text boxes.

SumOfQuantity is set you stanard format and ProductPrice is set to Currency format.

I was putting the txtSumTotalCost in the Page Footer.
 
You didn't mention anything about fields when this is the key to using Sum().

I didn't ask anything about "format" since format is not usually significant to your issue. I did mention "type fields" which you ignored.

I mentioned: "You can't Sum() a control"

I mentioned: "You can't Sum() anything in the Page sections of your report."

Is your issue resolved or are you still looking for assistance?


Duane
Hook'D on Access
MS Access MVP
 
SumOfQuantity text box control source: =Sum([Quantity])

Quantity is numeric type as well as ProductPrice.

Still looking for assistance.
 
You still didn't use the word "field" in your reply. Do you understand what I mean by "field"?

Have you tried something like:
Code:
  =Sum([Quantity]*[ProductPrice])

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top