View Full Version : two combo boxes to populate a list box


RhysPhelps
10-30-2009, 05:24 AM
hi guys and girls,
i have a form ("Form1") that has two combo boxes ("Cost" and "Account") that i would like to use to populate the list box ("Ref"). The table is "BudgetRef" I have the query currently set at:-

SELECT BudgetRef.Budget_Reference, BudgetRef.Account_Name, BudgetRef.Cost_Center
FROM BudgetRef
WHERE BudgetRef.Cost_Center=Forms!Form1!Cost

so that the "Cost" combo correctly populates the "Ref" list box. how would i go about adding the 2nd combo ("account") to the query? i've Tried to add AND in the WHERE but it returns a blank list box.

Oh and i've added the .requery on the combo changes so i dont think t is that.

Any help would be great

Thanks

lcook1974
10-30-2009, 08:48 AM
could you post a sample DB?

Scooterbug
10-30-2009, 09:05 AM
hi guys and girls,
i have a form ("Form1") that has two combo boxes ("Cost" and "Account") that i would like to use to populate the list box ("Ref"). The table is "BudgetRef" I have the query currently set at:-

SELECT BudgetRef.Budget_Reference, BudgetRef.Account_Name, BudgetRef.Cost_Center
FROM BudgetRef
WHERE BudgetRef.Cost_Center=Forms!Form1!Cost
AND BudgetRef.Account_Name = Forms!Form1!Account

so that the "Cost" combo correctly populates the "Ref" list box. how would i go about adding the 2nd combo ("account") to the query? i've Tried to add AND in the WHERE but it returns a blank list box.

Oh and i've added the .requery on the combo changes so i dont think t is that.

Any help would be great

Thanks

I am assuming that you are using the Query Builder Grid to add the criteria. Also, what happens when you run the query through the Query Builder Grid with known values?