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!

Calculating Sum of Calculated Values

Status
Not open for further replies.

JackDS

Programmer
Feb 8, 2005
2
0
0
BE
Hello,

I have this problem I've been breaking my head over and am just hopelessly stuck on.

In my report I have different entries for salespeople. For each entry there is a commission that is calculated with a function and stored in a textfield called 'CommissionAmount'.

At the bottom of my report I want to put the total of these values. So I use Sum([CommissionAmount]). Unfortunately this displays an #error. Does Access only allow you to Sum actual field values? What would be the most elegant way to still recover this total value and store it at the bottom of the report?

Thanks for any help!
 
JackDS said:
At the bottom of my report I want to put the total of these values. So I use Sum([CommissionAmount]). Unfortunately this displays an #error.
Where is your Calculated text located? Is it in the Page footer ? Report footer ?
You will get #Error if it is in the Page footer.
You need to place it in the Report footer or it should be in the Group footer
hope this helps

Zameer Abdulla
[sub]Jack of Visual Basic Programming, Master in Dining & Sleeping[/sub]
Visit Me
 
You can't sum a text box. You can generally sum the control source expression from a text box. For instance, if you control source in the detail section is:
=[UnitCost] * [Qty] * (1-[Discount])
you can sum this in a Group or Report Footer with:
=Sum([UnitCost] * [Qty] * (1-[Discount]))


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Seems like it was a combination of problems. First I had to use the function with control source parameters instead of the textbox value. And it was indeed in the Page footer, so I moved it. All works perfect now, thanks all for the quick replies!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top