Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I get data item from one of records matching the key

Status
Not open for further replies.

EdAROC

Programmer
Aug 27, 2002
93
US
Situation: Creating Scheduling Labels of manufacturing operations for jobs. Some of the data is different for different operations. In one case we want to put Item# of the board material that will be used (only one board per job), and there are multiple/different materials from inventory ALLOCated to the job. Fields:
JOB_NO - key field for relating
ITEM_NO - Identifies the inventory item
MTL_TYP - Identifies material category, in our case we want the "BRD".

I tried:
Field: ITEM_NO
Table: [ALLOC]
Criteria: [ALLOC]![MTL_TYP] = "BRD"

It didn't work. Luckily (or maybe not - the technique for this may resolve a followup question) we don't need to identify different materials for different operations.
 
Create a query with ITEM_NO AND MTL_TYP. In the criteria row, type "BRD". Then uncheck the show box. That way you don't have to see it if you don't want to.
 
Would the query you mentioned to create be a separate one? And then my "main" query would access that one?
Thanks.
 
Perhaps create a brand new query. Go to design view - do not add any tables. Click the button that says SQL, should be a bit below the File menu. It will bring up a code window that should only say:

SELECT;

For this query, lets start with something like this:
Code:
SELECT t.ITEM_NO
, t.MTL_TYP

FROM ALLOC as t

WHERE t.MTL_TYP = "BRD";



~Melagan
______
"It's never too late to become what you might have been.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top