S
Sophie
hi
I have 2 comboboxes (cbxReg and cbxArea) on my form (frmReg). cbxReg gets
its values from a query, and I set its Default Value property
=[cbxReg].[ItemData](0). Works great.
Now, the 2nd combobox gets its Row Source from the AfterUpdate event of the
1st combobox:
'to ensure cbxArea CLEARED if cbxReg changed
Me!cbxArea.Value = Null
'now reset Row Source of cbxArea
Me!cbxArea.RowSource = "SELECT qryReg.RegID,qryReg.RegName FROM qryReg
WHERE RegID= " &
Me!cbxReg.Column(0) & ";"
Forms!frmReg.requery
Me!cbxArea.SetFocus
My problem is in how to set the 2nd comboboxes default value. When the form
opens, I'd like its default value to be =[cbxArea].[ItemData](0), but only
AFTER its RowSource is set by the 1st combobox. Any clues how I can get this
to work?
much thanks
I have 2 comboboxes (cbxReg and cbxArea) on my form (frmReg). cbxReg gets
its values from a query, and I set its Default Value property
=[cbxReg].[ItemData](0). Works great.
Now, the 2nd combobox gets its Row Source from the AfterUpdate event of the
1st combobox:
'to ensure cbxArea CLEARED if cbxReg changed
Me!cbxArea.Value = Null
'now reset Row Source of cbxArea
Me!cbxArea.RowSource = "SELECT qryReg.RegID,qryReg.RegName FROM qryReg
WHERE RegID= " &
Me!cbxReg.Column(0) & ";"
Forms!frmReg.requery
Me!cbxArea.SetFocus
My problem is in how to set the 2nd comboboxes default value. When the form
opens, I'd like its default value to be =[cbxArea].[ItemData](0), but only
AFTER its RowSource is set by the 1st combobox. Any clues how I can get this
to work?
much thanks