Solved

Revise DSum syntax

Posted on 2014-11-24
3
153 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
3 Comments
 
LVL 34

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 49

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

705 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now