Zydeceltico
Registered User.
- Local time
- Yesterday, 20:32
- Joined
- Dec 5, 2017
- Messages
- 843
Hi All -
I have a form that has cboJob, cboWorkstation, and cboPieceToInspect.
I want to populate cboPieceToInspect by running a query that uses the values selected in cboJob and cboWorkstation as criteria.
I am not sure how to set this up.
I do know that this SQL works when I manually enter ID numbers at the prompts when I run it from the QBE. I just don't know how to tell Access to get the values for the WHEREs from cboJob and cboWorkstation.
Thanks for any insight!
Tim
I have a form that has cboJob, cboWorkstation, and cboPieceToInspect.
I want to populate cboPieceToInspect by running a query that uses the values selected in cboJob and cboWorkstation as criteria.
I am not sure how to set this up.
I do know that this SQL works when I manually enter ID numbers at the prompts when I run it from the QBE. I just don't know how to tell Access to get the values for the WHEREs from cboJob and cboWorkstation.
Thanks for any insight!
Tim
Code:
SELECT tbljobs.job_id,
tblworkstations.workstation_id,
tblparts.parttype
FROM (tblfinalproducts
INNER JOIN tbljobs
ON tblfinalproducts.finalproduct_id = tbljobs.finalproduct_fk)
INNER JOIN ((tblworkstations
INNER JOIN tblparts
ON tblworkstations.workstation_id =
tblparts.workstation_fk)
INNER JOIN tblassemblycomponents
ON tblparts.part_id = tblassemblycomponents.part_fk)
ON tblfinalproducts.finalproduct_id =
tblassemblycomponents.finalproduct_fk
WHERE ( ( ( tbljobs.job_id ) = [enter job id:] )
AND ( ( tblworkstations.workstation_id ) = [enter ws id:] ) );