Refreshing a Combo Box

S

Steve C

I have a user form with two combo boxes. In ComboBox1, the user selects a
Division from 1-16. Based on that selection, ComboBox2 is then populated with
the appropriate corresponding choices. My problem is that if the user
chooses Division 3 for example, then changes his mind and selects Division 7
(before closing the form), ComboBox2 then populates with choices for both
Division 3 and 7. Is there a command for refreshing ComboBox2 upon changing
ComboBox1 so that it only displays the selected division? Thanks.

Steve C
 
J

Jay Freedman

Steve said:
I have a user form with two combo boxes. In ComboBox1, the user
selects a Division from 1-16. Based on that selection, ComboBox2 is
then populated with the appropriate corresponding choices. My
problem is that if the user chooses Division 3 for example, then
changes his mind and selects Division 7 (before closing the form),
ComboBox2 then populates with choices for both Division 3 and 7. Is
there a command for refreshing ComboBox2 upon changing ComboBox1 so
that it only displays the selected division? Thanks.

Steve C

Hi Steve,

In the code (ComboBox1_Change()?) that loads items into ComboBox2, the first
statement should be

ComboBox2.Clear

That will delete all the choices currently in the list, and the code will
then start adding items to an empty list.
 
S

Steve C

Thank you, Jay! (or should I call you Obi-Wan?)

Steve C (not quite the programming jedi yet)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top