Solved

Multiple criteria DSum issue

Posted on 2011-03-16
4
327 Views
Last Modified: 2013-11-05
Can someone tell me what's wrong with this code?

Me.txtTotThisDayThisCat = (Me.txtQty + Nz(DSum("Qty", "tblProjectDetail", "[CapCat] = " & Chr(34) & Me.txtCapCat & Chr(34)), 0) And "[DropDueDate] = #Me.txtdropduedate#")
0
Comment
Question by:SteveL13
  • 3
4 Comments
 
LVL 75
ID: 35152339
Try this:

 Me.txtTotThisDayThisCat = (Me.txtQty + Nz(DSum("Qty", "tblProjectDetail", "[CapCat] = " & Chr(34) & Me.txtCapCat & Chr(34)), 0) & " And [DropDueDate] = #" & Me.txtdropduedate & "#")


mx
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35152356


Me.txtTotThisDayThisCat = (Me.txtQty + Nz(DSum("Qty", "tblProjectDetail", "[CapCat] = " & Chr(34) & Me.txtCapCat & Chr(34) & " And [DropDueDate] = #Me.txtdropduedate#" ), 0))
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35152358
oops


Me.txtTotThisDayThisCat = (Me.txtQty + Nz(DSum("Qty", "tblProjectDetail", "[CapCat] = " & Chr(34) & Me.txtCapCat & Chr(34) & " And [DropDueDate] = #" & Me.txtdropduedate &"#" ), 0))
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 35152363
this will also work




Me.txtTotThisDayThisCat = (Me.txtQty + Nz(DSum("Qty", "tblProjectDetail", "[CapCat] = '"  & Me.txtCapCat &  "' And [DropDueDate] = #" & Me.txtdropduedate &"#" ), 0))
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

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…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
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…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

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