Linked Combo Boxes

  • Thread starter Thread starter o wilson
  • Start date Start date
O

o wilson

Hello,

I have two tables, tblDivisions and tblCostCode.
tblDivisions has two columns - DivID and Divisions.
There are 18 divisions numbered 1-18.

tblCostCode has three columns - CostCodeID, Div and
CostCode. Each Division can have several different cost
codes.

I have a form called frmLinkedControls with two combo
boxes, cboDiv and cboCostCode. I'd like cboCostCode to
display only those cost codes that apply to the division
selected in cboDiv. Here is my SQL statement:

SELECT tblCostCode.Div, tblCostCode.CostCode
FROM tblCostCode
WHERE (((tblCostCode.Div)=[Forms]![frmLinkedControls]!
[cboDiv]))
ORDER BY tblCostCode.Div, tblCostCode.CostCode;

cboCostCode is always empty, what have I done wrong?

TIA

Owen
 
cboCostCode is always empty, what have I done wrong?

Add this to the After Update event of cboDiv:

Me.cboCostCode.Requery

- Kurt
 
That didn't do it. Any other Suggestons?
-----Original Message-----
cboCostCode is always empty, what have I done wrong?

Add this to the After Update event of cboDiv:

Me.cboCostCode.Requery

- Kurt

o wilson said:
Hello,

I have two tables, tblDivisions and tblCostCode.
tblDivisions has two columns - DivID and Divisions.
There are 18 divisions numbered 1-18.

tblCostCode has three columns - CostCodeID, Div and
CostCode. Each Division can have several different cost
codes.

I have a form called frmLinkedControls with two combo
boxes, cboDiv and cboCostCode. I'd like cboCostCode to
display only those cost codes that apply to the division
selected in cboDiv. Here is my SQL statement:

SELECT tblCostCode.Div, tblCostCode.CostCode
FROM tblCostCode
WHERE (((tblCostCode.Div)=[Forms]![frmLinkedControls]!
[cboDiv]))
ORDER BY tblCostCode.Div, tblCostCode.CostCode;

cboCostCode is always empty, what have I done wrong?

TIA

Owen
.
 
Back
Top