R
Rich J
I have a combobox that lists only values from each of six other comboboxes.
That works great. I want to limit the choices of a third combobox based on
the value of the second. I am having the worst time getting it right.
First 6 comboboxes each lists one company name selected
The second combobox rowsource becomes those 6 choices.
The third combobox I want a list of the workers limited to only the company
picked in the second. The tWkrID field is what would be stored and the full
name shown in the combobox. I can get it to work for all the workers from
all the companies but can't filter it to one company.
tblWorkers -> tWkrID, tWkrFirstName,tWkrLastName, fgnCraftID, fgnContractorID
tblContractors-> tContrID,tContrName
query
qryContractorWorkers-> tWkrID,qWkrFullName,fgnCraftID,tCraft,
fgnContractorID, Contractor
this SQL populates the second combobox
"SELECT DISTINCT tblContractors.tContrID,tblContractors.tContrName FROM
tblContractors WHERE (tblContractors.tContrID=[fgnContrID1] OR
tblContractors.tContrID=[fgnContrID2] ..... OR
tblContractors.tContrID=[fgnContrID6])"
This is what I've tried for the third
SELECT DISTINCT qryContrWkrs.tWkrID,
qryContrWkrs.qWkrName,qryContrWkrs.fgnContrID,qryContrWkrs.tCraft FROM
qryContrWkrs WHERE qryContrWkrs.fgnContrID= Combobox2
Any ideas would be greatly appreciated
That works great. I want to limit the choices of a third combobox based on
the value of the second. I am having the worst time getting it right.
First 6 comboboxes each lists one company name selected
The second combobox rowsource becomes those 6 choices.
The third combobox I want a list of the workers limited to only the company
picked in the second. The tWkrID field is what would be stored and the full
name shown in the combobox. I can get it to work for all the workers from
all the companies but can't filter it to one company.
tblWorkers -> tWkrID, tWkrFirstName,tWkrLastName, fgnCraftID, fgnContractorID
tblContractors-> tContrID,tContrName
query
qryContractorWorkers-> tWkrID,qWkrFullName,fgnCraftID,tCraft,
fgnContractorID, Contractor
this SQL populates the second combobox
"SELECT DISTINCT tblContractors.tContrID,tblContractors.tContrName FROM
tblContractors WHERE (tblContractors.tContrID=[fgnContrID1] OR
tblContractors.tContrID=[fgnContrID2] ..... OR
tblContractors.tContrID=[fgnContrID6])"
This is what I've tried for the third
SELECT DISTINCT qryContrWkrs.tWkrID,
qryContrWkrs.qWkrName,qryContrWkrs.fgnContrID,qryContrWkrs.tCraft FROM
qryContrWkrs WHERE qryContrWkrs.fgnContrID= Combobox2
Any ideas would be greatly appreciated