Unanswered: Nested subqueries from subform controls
I have a query that searches for product information based on data entered into a subform. I have used nested subqueries to specify the order I want to search the product table, but am having trouble getting the data from the subform. When I run the query from SQL view, the parameters pop up in the correct order. However, the query doesn't generate any information. When I use the button on the subform to run the query, parameter boxes pop up, even though the controls on the subform have the data entered.
SELECT tblProducts.ProductName, tblProducts.Purpose, , tblProductDetails.Units, tblProductDetails.Availability, tblProductDetails.Cost, tblProductDetails.Rating, tblProductDetails.Quantity
FROM tblProducts INNER JOIN tblProductDetails ON tblProducts.ProductID=tblProductDetails.ProductID
WHERE ((((SELECT Availability FROM tblProductDetails WHERE Availability=[Forms]![frmOrderEntry]![subDetail]!Forms![ctrAvailability] IN (SELECT Quantity FROM tblProductDetails WHERE Quantity <=[Forms]![frmOrderEntry]![subDetail]!Forms![ctrQuantity] IN (SELECT Purpose FROM tblProductDetails WHERE Purpose=[Forms]![frmOrderEntry]![subDetail]!Forms![ctrPurpose]))))<>False));