Combo boxes in userform auto drop down problem

  • Thread starter Thread starter joshuafandango
  • Start date Start date
J

joshuafandango

Hi guys,

I'm using the following for a series of comboxes to display the dd
list when the combobox is selected (using tab as opposed to mouse
clicks).

Private Sub ComboBox2_Enter()
ComboBox2.DropDown
End Sub

This works fine,but only on alternate boxes! ComboBox2 works fine, 3
doesn't work, 4 does & so on.

Any ideas?

Cheers,
JF.
 
The problem is that a combo box cannot drop down while another is in the
state. So you have to give the departing combobox a little time to close:

Assuming the userform has 4 comboboxes:

Private Sub UserForm_Initialize()
ComboBox1.List = Array("a", "b", "c")
ComboBox2.List = Array("a", "b", "c")
ComboBox3.List = Array("a", "b", "c")
ComboBox4.List = Array("a", "b", "c")
End Sub

Private Sub ComboBox1_Enter()
Set CB = ComboBox1
Application.OnTime Now, "DD"
End Sub

Private Sub ComboBox2_Enter()
Set CB = ComboBox2
Application.OnTime Now, "DD"
End Sub

Private Sub ComboBox3_Enter()
Set CB = ComboBox3
Application.OnTime Now, "DD"
End Sub

Private Sub ComboBox4_Enter()
Set CB = ComboBox4
Application.OnTime Now, "DD"
End Sub

And in a standard module:

Public CB As ComboBox

Sub DD()
CB.DropDown
End Sub



--
Jim
| Hi guys,
|
| I'm using the following for a series of comboxes to display the dd
| list when the combobox is selected (using tab as opposed to mouse
| clicks).
|
| Private Sub ComboBox2_Enter()
| ComboBox2.DropDown
| End Sub
|
| This works fine,but only on alternate boxes! ComboBox2 works fine, 3
| doesn't work, 4 does & so on.
|
| Any ideas?
|
| Cheers,
| JF.
 

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

Back
Top