I am trying to figure out how to clear all items from a combobox
(Access 2002).
On my form, I have to comboboxes. Combobox 2 is populated with a set
of child data dependent on the parent data item selected in Combobox 1.
This is done through the .AddItem method of Combobox 2 looping through
the recordset.
This works fine, until --> the data item in the Combobox 1 is changed,
then Combobox 2 just appends the "new" related child data to the what
was previously there. I need it to contain only the data items that
are related to the item currently selected in the Combobox 1.
Apparently, older versions of Access' Combobox had a .Clear method
(???) -- but this seems to be removed from later versions of Access.
The code to fill combobox 2 is as follows:
strSpecies = "SELECT Common_Name FROM Taxa WHERE Taxa.TaxaName = '" &
[Forms]![frm_SelectforEdit]![Combobox_1] & "'"
rst.Open strSpecies, CurrentProject.Connection
Combobox_2.RowSourceType = "Value List"
Do Until rst.EOF
Combobox_2.AddItem rst!Common_Name
rst.MoveNext
Loop
Any help would be appreciated