Solved

DSum syntax in a subreport

Posted on 2004-09-23
5
359 Views
Last Modified: 2010-05-18
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


0
Comment
Question by:LoveToSpod
  • 2
  • 2
5 Comments
 
LVL 12

Expert Comment

by:pique_tech
ID: 12134189
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 Comment

by:LoveToSpod
ID: 12134263
The problem is if you have sum of volumes * rates then you do not get the individual calculations!! E.g

[Volume]  [rate]  [Answer]
      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
 
LVL 12

Accepted Solution

by:
pique_tech earned 500 total points
ID: 12134471
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
 
LVL 3

Expert Comment

by:gemost
ID: 12134499
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 Comment

by:LoveToSpod
ID: 12134581
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

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question