Populating a combo box at run time

  • Thread starter Graham Whitehead
  • Start date
G

Graham Whitehead

Hi, I have a couple of comboboxes - the contents of the second are dependent
on the selection in the first one. I have this part running fine. the
problem I am having is that when a new option is selected in the first combo
box the contents of the second combobox do not change until the
dropbuttonclick even.

To make things clear here is the order of operations:

user clicks the drop down arrow on combobox 1 > user then makes a selection
from combobox 1 > this calls the code to populate the second combobox
dependant on what user has selected > THIS IS WHERE THE PROBLEM IS -
basically i want the first option of the new list to be automatically
displayed in the combobox now - however, the old value is left there until
the user clicks the drop down arrow.

Hope this makes sense. Can anyone help me out?

thanks for reading this.
 
G

Guest

Private Sub combobox1_Click()

' code that populates comobobox2

Combobox2.Listindex = 1
End sub
 
G

Guest

Ok, my problem is how do you do the first part of your post?

I have a combobox that I need to pick up a list which is determined by
another combobox. i.e combobox1 is criteria A, I then need all the data in
another sheet that one column matches this criteria to be available in
combobox2. I have too many records to manually sort and is not practical to
have to create lists manually. What I need is some way of picking out all of
criteria A automatically.

Hope you can help, thanks.
 

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