473,722 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple Criteria Search.....Prop er Syntax

74 New Member
Please help. I know the sysntax is wrong. Here are some details. I am looking for the sum of past shipped items. I originally wrote this Dsum with only one criteria, but because of multiple lineitems with the same [workorder] number it was adding all of the items with the same [workorder]....obviously. So i tried to just find records with multiple criteria..... part number [pn] (formatted as text) and the [workorder] (formatted as number).

Expand|Select|Wrap|Line Numbers
  1. Nz(DSum("shipqty", "tblshippingdetails", "[pn] =" & """ & Forms!frmsodetailssearch.pn & """ & " And [WorkOrder] =" & Me![SalesOrderNumber]), 0)
I really strugle when it comes to multiple criteria in filters and counts. I am trying to get better. By the way..... this code does not give an error, but it is not giving the correct result. originally i tried

Expand|Select|Wrap|Line Numbers
  1. Nz(DSum("shipqty", "tblshippingdetails", "[WorkOrder] =" & Me![SalesOrderNumber] and "[pn] =" Forms!frmsodetailssearch.pn), 0)
But i got syntax error during compile. I figured when i didnt get the error (top line of code) that i had succeeded...... but nope...no success.
Mar 5 '09 #1
3 3638
FishVal
2,653 Recognized Expert Specialist
Hello.

You could find an answer in Quotes (') and Double-Quotes (") - Where and When to use them article.

Regards,
Fish.

P.S. If you want to include double-quote in string constant you should type it twice to let Access distinguish it from string end.
Mar 5 '09 #2
kstevens
74 New Member
Oops, ok so 4 " instead of 3 " worked great. Thanks.
Mar 5 '09 #3
FishVal
2,653 Recognized Expert Specialist
You are welcome.

Best regards,
Fish.
Mar 5 '09 #4

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

Similar topics

0
1408
by: Alistair | last post by:
hello again people... Access2000, IIS6, win XP pro I have a form where users can enter search criteria for various products. now, if this form has 2 fields, colour and size (it wil have more but I'm assuming the the principle for two fields will be the same for ten fields) what would be the correct syntax for performing a query where the user
1
8773
by: TH | last post by:
I am (still :) working on a recipe database. Now I am trying to figure out how to set it up for an ingredient search. What I want it to be able to do is three things: 1. Search based on just one ingredient 2 Search based on two ingredients so that the recipe would have to have both ingredients to show up in the results 3. Search based on three ingredients so that the recipe would have to have all three ingredients to show up...
8
1580
by: hiro | last post by:
Hi there, I'm very new to python, the problem I need to solve is whats the "best/ simplest/cleanest" way to read in multiple files (ascii), do stuff to them, and write them out(ascii). -- import os filePath = ('O:/spam/eggs/')
3
2448
by: AishaKhalfan | last post by:
Hi, :wave: I have many search criteria in my program, such as: search by name, search by age, search by gender, search by city the user can search by name only, or by name and age, or by name and gender or by city and gender ... etc .. how am going to display the result for each search criteria ?
5
11983
by: mforema | last post by:
Hi Everyone, I want to search records by typing in multiple keywords. I currently have a search form. It has a combo box, text box, Search command button, and a subform. The combo box lists the names of the fields found in my subform. The search form is supposed to allow a user to choose which field he/she wants to search by and then type a keyword(s) in the text box. The subform should display the filtered results. My problem occurs...
1
2001
by: Kye | last post by:
It has been a while since using vb an now I have started a project and I am not sure where my mistake is in my code. Basically what I am doing is trying to build a multiple search string with certain criteria being asked, the criteria is in 4 separate fields with a search where I am able to enter multiple information, or just search a single field . Now it works to a certain extent but when trying to enter a double field for model and colour...
1
4166
by: jcf378 | last post by:
Hi all-- Does anyone have any insight as to how I might create a search form that allows a user to select criteria based on any related table in the whole database. The search form I have now only allows me to filter based on variables in a single table. I would like to have a search form where I can select multiple variables (from various linked tables) to filter by, and return results based on this multi-table filter. Allen Browne...
0
1645
by: cannonpm | last post by:
Greetings and salutations. I have developed an A2K3 MDB and have a search form modeled after Allen Browne's search form (http:// allenbrowne.com/ser-62.html). It works well except for records which have multiple related records in 1:many relationships and many:to:many relationships. To view my results, I created a query called qryAllData which contains all of the data from several tables for each record. For example, say I have one...
5
9239
Frinavale
by: Frinavale | last post by:
I'm playing with an ASP.NET MVC application and I've run into a bit of a problem. I am pretty new to ASP.NET MVC and just barely understand the basics to get things to work at this point. I have a PersonModel, a PersonController, and a bunch of views that let a user add a new person, edit a person and search for people. I am not using a DataBase in the back end. Everything I'm doing depends on an external DLL that returns "person"...
0
8863
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9238
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9157
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9088
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5995
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4502
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4762
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.