Access 2003 Query Issue

Posted on 2015-02-05
Last Modified: 2015-02-06
I have a query in Access 2003 that is quite extensive.  When I run the query one of the criteria is not being met and it returns blank fields.  Is there a way that Access can tell me what criteria did not get met?  This way I can go straight to the problem and correct it.  Please advise and thanks!
Question by:submarinerssbn731
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
  • 5
  • 2
  • 2
  • +2

Author Comment

ID: 40591858
Better yet can Access show the query return if the field is null or contains the criteria requested?
LVL 62

Expert Comment

by:☠ MASQ ☠
ID: 40593171
You could use "Is Null" or "Is Not Null" as the criteria for the query field.
Are your queries in MSSQL or DesignView?
Normally I'd just backtrack through the expression used to populate the field to find likely contenders that are now missing - depends just how "extensive" your extensive query is.
LVL 84
ID: 40593308
Can you post the SQL of the query?
To Patch or not to Patch? That is the question!

Don't get caught out like thousands of others around the world in the recent Ransomware Fiasco!
- Why it's not a good idea to wait before Patching
- Sensible approaches to Patching discussed
- Add your feedback, comments and suggestions


Author Comment

ID: 40593481
SELECT [PSI Order Details].[Order Seq No], [PSI Order Details].[PO Number] AS PONumber, [PSI Order Details].PlantCode, [PSI Order Details].DLOC, BOM.CUSTNO, BOM.EC_LEVEL, [PSI Order Details].DockCode, CStr([Label Registry].Quantity) AS Qnty, [Label Registry].JobNo AS LotNo, [Label Registry].[Label ID] AS SN, [Label Registry].PSINO, [Label Registry].JobNo, [Label Registry].[Label ID] AS LabelNo, [Label Registry].[Label number] AS BoxNo, Format([DateProd],"mmmyyyy") AS FIFO, BOM.MATERIALID2 AS MatID, "113222074" AS MfgDUNS, BOM.PARTNAME, Tbl_Ship_to.DUNSCode, Format([DateProd],"yy/mm/dd") AS MfgDate, BOM.EC_DATE, BOM.CUSTCODE, Date() AS Today, BOM.PARTWEIG, [Label Registry].CartonLbs, Tbl_Ship_to.LocationCode
FROM (Tbl_Ship_to INNER JOIN (BOM INNER JOIN [PSI Order Details] ON BOM.PSINO = [PSI Order Details].PSINO) ON Tbl_Ship_to.SHIPTO = [PSI Order Details].[Ship To]) INNER JOIN [Label Registry] ON BOM.PSINO = [Label Registry].PSINO
WHERE ((([PSI Order Details].[Order Seq No])=[Forms]![frm_NEX_Labels]![lstDocIDs]) AND (([Label Registry].[Label ID])=[Forms]![frm_NEX_Labels]![LabelID]))
ORDER BY [Label Registry].JobNo, [Label Registry].[Label ID];

Author Comment

ID: 40593485
Design view.
LVL 62

Expert Comment

by:☠ MASQ ☠
ID: 40593649
Are you getting one blank field (if so which one) or does the query return no results?

Author Comment

ID: 40593657
returns no results.
LVL 100

Expert Comment

ID: 40593759
When you enter values on the form, are you sure there is a record that matches the values?

If you take the where clause off do you get data?

LVL 47

Accepted Solution

Dale Fye (Access MVP) earned 500 total points
ID: 40593788
A couple of things to look at:
1.  You are joining 4 tables with inner joins, so you will only get records where there are related records in each of those tables.  If you don't get any records when you run your query without the WHERE clause, this could be the cause, in which case you should consider changing the joins to LEFT JOINs (without the WHERE clause) to help you determine which table is missing the matching records.

2. Have you checked to make sure that the fields you are using in your WHERE clause are of the same data type as the controls on the form?  You might want to consider actually declaring those form controls as parameters in your query, so that the data will be typed properly.

Author Closing Comment

ID: 40594532
Great answer!  Thanks!
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 40594551
glad to help.

Can you share with us which of my recommendations solved the problem.

Featured Post

SuperAntiSpyware Licenses Discounted by 25% !

Exclusive offer to Experts Exchange Members!
Buy SuperAntiSpyware License(s) from us and save 25% on the regular purchase price.
- Includes Full SuperAntiSpyware Vendor Support Entitlements
- Your Subscription does not begin until you activate your license
- Buy for your friends

Question has a verified solution.

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

In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

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