removing all items from a combo box
Posted on 2008-10-07
I am dynamically filling a combo box based on a selection in another combo box. On the first selection, everything works fine. However, if the user changes his mind, I want to remove the items from the combo box and then re-add the new items based on the new selection. To clear the combo box, I am trying to loop through the items in the combo box and remove them using removeitem as follows:
for i = 0 to cbo.listcount-1
Note - There were 4 items in the combo box. It loops 2 time and then I get an error "Unable to remove item . "2" not found in list.