Solved

Revise DSum syntax

Posted on 2014-11-24
3
159 Views
Last Modified: 2014-11-24
I have the following DSum syntax for the control source of a field on a form.  But I need to change it,  Here is the current code:

=DSum("[QTY_ORDERED]","tblInventory","[PART_NO] = '" & [Forms]![frmParts]![txtPART_NO] & "'")

But I need to add two qualifiers to it.

Where TRNX_TYPE = "I" or "O"
How can I change this control source?

I tried:

=DSum("[QTY_ORDERED]","tblInventory","[PART_NO] = '" & [Forms]![frmParts]![txtPART_NO] & "'" WHERE [TRNX_TYPE] = "I" or "O")

but it isn't right.
0
Comment
Question by:SteveL13
[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
3 Comments
 
LVL 37

Assisted Solution

by:PatHartman
PatHartman earned 250 total points
ID: 40463049
=DSum("[QTY_ORDERED]","tblInventory","[PART_NO] = '" & [Forms]![frmParts]![txtPART_NO] & "'" WHERE [TRNX_TYPE] = "I" or [TRNX_TYPE] = "O")

You have to repeat the operand.
0
 
LVL 50

Accepted Solution

by:
Gustav Brock earned 250 total points
ID: 40463216
It's also your (missing) single/double quotes:

=DSum("[QTY_ORDERED]","tblInventory","[PART_NO] = '" & [Forms]![frmParts]![txtPART_NO] & "' And [TRNX_TYPE] = 'I' or [TRNX_TYPE] = 'O'")

/gustav
0
 

Author Closing Comment

by:SteveL13
ID: 40463224
Thank you to both of you.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
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 Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

734 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