By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,491 Members | 879 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,491 IT Pros & Developers. It's quick & easy.

dsum function in a report

P: 76
Hi,

I have made a report that has a query as its record source. I put a text box in there that I want to run a dsum function off of a different query. The criteria that I need to use is that it returns the appropriate number for whatever name appears in the Name text box within the Name Header. Here's the formula I have:

=DSum("[Hours]","Overtime","Name=[Name]")

All it's giving me is the sum for everyones hours in the overtime query in each record on the report. Any ideas?

Thanks,

Charlie
Nov 16 '06 #1
Share this Question
Share on Google+
6 Replies


NeoPa
Expert Mod 15k+
P: 31,186
Try :
Expand|Select|Wrap|Line Numbers
  1. =DSum("[Hours]","Overtime","Name='" & [Name] & "'")
Nov 16 '06 #2

P: 76
That just gave me blanks in the report, any other suggestions?

Thanks
Nov 16 '06 #3

NeoPa
Expert Mod 15k+
P: 31,186
Not without more info Charlie.
What's the name of the field you're selecting on?
You used [Name] in your code so I did.
We are looking for a TextBox or ComboBox on a form I suspect.
Nov 16 '06 #4

MMcCarthy
Expert Mod 10K+
P: 14,534
Not without more info Charlie.
What's the name of the field you're selecting on?
You used [Name] in your code so I did.
We are looking for a TextBox or ComboBox on a form I suspect.
We are assuming Name is a text field. If its not then.

=DSum("[Hours]","Overtime","Name=" & [Name])

As NeoPa said:

& [Name] refers to the value in the control on the report for this field. Check the control to make sure it doesn't have a name like [Text4] or something else.
Nov 16 '06 #5

P: 76
Great, it worked. Thanks for your help.
Nov 16 '06 #6

MMcCarthy
Expert Mod 10K+
P: 14,534
Great, it worked. Thanks for your help.
You're welcome.
Nov 16 '06 #7

Post your reply

Sign in to post your reply or Sign up for a free account.