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

Using DSum

P: 76

I'm trying to build a text box in a form that will add hours for a two week period. I have created a query to return the hours in the two week range, but the same name and hour type will appear multiple times because of the different dates even though I put the group by function on.

Is it possible to do a dsum from a query rather than a table in the text box where it will sum the hours where name=x and hour type=y?


Sep 5 '06 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 1,418
So do you want to save in this text box the result information or
you want a sample calculation field that shows you this information?

I suppose you want a calculation field!

So you have to type in the control Source property:

=Dsum("Hours", "My_query_with_hours", "Name='" & X & "' AND week=" & str(y))

Where "Hours" is the field where are stored the hours in your query on which you want to do the sum

"My_query_with_hours" is Your query with hours


"Name='" & X & "' AND week=" & str(y) is the searching condition

Take care i've shown you the use of 2 types of values text and numbers

Name like a variable AS text
AND week as variable as number!
Sep 5 '06 #2

P: 76
Worked great, thanks for the help!
Sep 5 '06 #3

Post your reply

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