Help with DSum Function

robotpoop

New Member
Joined
Feb 6, 2015
Messages
6
Hi everyone.

I have one query (we'll call it Query A) that identifies transactions on an account based on certain criteria.

In a second query (Query B), I'm attempting to use DSum to pull in the total of the transactions from Query A, but whenever I run it I'm prompted to enter a parameter value.

Here's what I'm using as my expression:

Expr1: DSum([TRAN_AMT],[Query A])

What am I doing wrong? I've never used DSum before, so I'm expecting that I've overlooked something obvious here.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Usually this means a typo (you spelled something wrong or referenced a field/table that doesn't exist in the data source). Also be aware that prompts for a parameter can be in a query or any query called by that query -- so the problem could be in Query A, not Query B.

You might need to provide more information. On the surface, the syntax looks fine but of course it isn't - so there's more to the story.
 
Upvote 0
Here's the actual expression:

DSum([dmd Previous Curtailments]![TRAN_AMT],[dmd Previous Curtailments])
 
Upvote 0
Okay, well that now looks less certain because the third parameter possibly has wrong syntax. Are you meaning to apply a criteria? What is the criteria supposed to do?

See here for a full description of DSUM:
MS Access: DSum Function
 
Upvote 0
There's no criteria.

[dmd Previous Curtailments]![TRAN_AMT] is the field that I wish to sum, from the other query.

[dmd Previous Curtailments] is the other query.
 
Upvote 0
Syntax is important. Looks at how it is written in the link xenou provided.
Try:
Code:
[COLOR=#333333]DSum("TRAN_AMT","dmd Previous Curtailments")[/COLOR]
 
Upvote 0
Joe's syntax is correct. You can just use the string literals as in Joe's example and it will return the sum you want.

Post back if that's not sufficient (i.e., I could think of example where you are using form fields to sum different fields at different times so you want the user or some other procedure to dynamically alter the inputs to DSUM.
 
Upvote 0

Forum statistics

Threads
1,214,824
Messages
6,121,783
Members
449,049
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top