Solved

Access 2003 Query Issue

Posted on 2015-02-05
11
119 Views
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!
0
Comment
Question by:submarinerssbn731
  • 5
  • 2
  • 2
  • +2
11 Comments
 

Author Comment

by:submarinerssbn731
ID: 40591858
Better yet can Access show the query return if the field is null or contains the criteria requested?
0
 
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.
0
 
LVL 84
ID: 40593308
Can you post the SQL of the query?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:submarinerssbn731
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];
0
 

Author Comment

by:submarinerssbn731
ID: 40593485
Design view.
0
 
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?
0
 

Author Comment

by:submarinerssbn731
ID: 40593657
returns no results.
0
 
LVL 100

Expert Comment

by:mlmcc
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?

mlmcc
0
 
LVL 47

Accepted Solution

by:
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.
0
 

Author Closing Comment

by:submarinerssbn731
ID: 40594532
Great answer!  Thanks!
0
 
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.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article will show you how to use shortcut menus in the Access run-time environment.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

763 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