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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with 'sum'ing up a reports control

Status
Not open for further replies.

PreacherUK

Technical User
Sep 26, 2002
156
NL
hey guys,

I have a report, i'm running some calcs on the report. The control has a junk name text42 (at this point i'm not too fussed about the names).

The control has a small chunk of code in "=IIf([LOAN_OR_INV]="INV",(-1*[text35]),[text35])" this is effectivly making 'text42' equal 'text35' but negative in certain situations. So that when I sum all the instances of 'text42' I should arrive at the difference between the positive numbers and negative numbers.

When however I try to sum 'text42' access is prompting me to enter a value for 'text42'. I can make a control in the footer of my grouping equal the contents of the last instance of 'text42' but not the sum of 'text42'.

In advance I appologise for the crappy naming conventions but this is just a quick report that i'm throwing together to check my numbers before I promote this (with proper names) to a live production environment.

So, any ideas? Am I missing something fundamentally obvious? :) I'm sure I've run into things like this before, but solved it by changing the underlying query, but I cant do that this time, I need to summarise the control that is calc'ing on my report.


Cheers for any help!
 
Try using a DSUM function.

DSUM("[text42]","NameOfTable/Query")

The above function has no criteria associated with it so it will do the sum of text42 over the entire table or query in question.


HTH,


Steve
 
Access won't let you sum a calculated control. You must re-calculate it. Something like this:
Code:
=Sum(IIf([LOAN_OR_INV]="INV",(-1*[text35]),[text35]))

Hoc nomen meum verum non est.
 
Hahah would you believe me if I told you that 'text35' was an unbound calculated control?!

I'll see if I can recreate the whole equation process in the control I want the summarised number in
 
I've ditched this as the whole approach to the report seemd flawed. Thanks for all the input guys.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top