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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

subform select case from main form?

Status
Not open for further replies.

kevinwilson

Technical User
Jul 13, 2001
33
0
0
US
hello all,
i have a problem with a subform retrieving recordsets based on combo box on main form (IMS_frmTR)

My subform (query) consists of these fields:

Code:
SELECT Inventory.[UPC Code], Inventory.[Item Number], Inventory.Description, Inventory.Model, Inventory.[Serial Number], Inventory.Critical_flag, Inventory.Room, Inventory.Building, Inventory.[Status Code], Inventory.BinType, Inventory.Sysid
FROM Inventory
WHERE (((Inventory.BinType)='2') AND [COLOR=red]((Inventory.Sysid) Like Trim([IMS_frmTR]![Project Number])));[/color]

I'd like the subform to return all records where the main form (IMS_frmTR) "Project Number" field is equal to the "sysid" field within the subform. I think my problem is in the WHERE statement as I don't know how pull the data from the IMS_frmTR form. The red is not working for me!

Pulling all records from the inventory table is easy enough but I only want to display records where IMS_frmTR.[Project Number] is equal to Inventory.Sysid.

Hope this is sufficient info...

Rgds,
Kevin
 
Thanks to all the would be responders ;) , but I managed to resolve my problem!

Code:
SELECT Inventory.[UPC Code], Inventory.[Item Number], Inventory.Description, Inventory.Model, Inventory.[Serial Number], Inventory.Critical_flag, Inventory.Room, Inventory.Building, Inventory.[Status Code], Inventory.BinType, Inventory.Sysid
FROM Inventory
WHERE (((Inventory.BinType)='2') AND ((Inventory.Sysid) Like ([Forms]![IMS_frmTR]![Project Number])));

Was a pretty simple fix after all.

Rgds,
Kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top