# DSum syntax in a subreport

Hi,

I'm having a major problem trying to get this to work.

I have a subreport that calculates within the detail of a subreport like this:

[Volume]  |  [IOProductName]   |  [Rate]   |  [Text41]
---------------------------------------------------------------
500               Whatever Text           30             15,000
200               Whatever Text           40               8,000
---------------------------------------------------------------

In the report footerI need the sum of [Text41]. I have tried simply writing Sum([Text41]) and the 'Enter parameter Value' promt comes up looking for value of [Text41].

How do I do this?

Cheers,

LoveToSpod

###### Who is Participating?

Commented:
I'm not sure you did what I suggested.  Not to duplicate what you'd done before, exactly, but to sum it:

SUM([Volume]*[Rate])

This works for me in a report footer.  Unless I've completely misunderstood your question...

I have the following data:
v     r     a (calculated [v]*[r])
2    15    30
3    15    45
4    15    60
the field in the footer is sum([v]*[r]) and it returns the expected answer 135

0

Commented:
Is Text41 already a calculated control, say [Volume]*[Rate]?

If it is, then you cannot aggregate over it.  Instead, you must have Sum([Volume]*[Rate]).

Hope this helps.
0

Author Commented:
The problem is if you have sum of volumes * rates then you do not get the individual calculations!! E.g

5           4          20
6           8          48

Correct TOTAL  =     68
Simple ([Volume]*[Rate]) = 132

Is there a more simple way of doing this?

I need the answer real soon, so I'm upping the points...
0

Commented:
Create another text box in the details section of the subreport. Then as its control source put = sum(text41). you can make the text box invisible and then reference it in the  footer. You may even be able to copy it into the footer before you make it invisble in the detail section.

HTH
gemost
0

Author Commented:
You hero,

Cheers for re-iterating it... For some reason I need to divide the answer by 1000 to get the correct number!!! Dunno why, maybe something I haven't spotted yet. Brilliant.

Sorry gemost, I tried that, and it still prompts for the value of [Text41]... Dunno why Grrrr...

Thanks folks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.