clearing and repopulating combobox

  • Thread starter Thread starter Lee Bailey
  • Start date Start date
L

Lee Bailey

I have a combobox that is repopulated based on the selection of one of two
radiobuttons. The lists to be loaded into the cb are mutually exclusive.

I know I can use .requery to repopulate the combo based on the current rb
selection.

But how do I clear the current selection from the cb and then select the
first item in the new list after the radiobuttons are toggled.

Thanks,
Lee
 
Something like this:

Private Sub frameName_AfterUpdate()
Me.cboBoxName.Value = Null
Select Case Me.frameName.Value
Case 1
Me.cboBoxName.RowSource = "QueryName1"
Case 2
Me.cboBoxName.RowSource = "QueryName2"
End Select
Me.cboBoxName.Value = Me.cboBoxName.ItemData(0)
End Sub
 
Back
Top