Solved

DSum syntax in a subreport

Posted on 2004-09-23
5
370 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

695 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