PC Review


Reply
Thread Tools Rate Thread

Combo boxes in userform auto drop down problem

 
 
joshuafandango@dsl.pipex.com
Guest
Posts: n/a
 
      6th Mar 2008
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.
 
Reply With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      6th Mar 2008
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
<(E-Mail Removed)> wrote in message
news:2e7496cc-1b79-47c7-807a-(E-Mail Removed)...
| 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.


 
Reply With Quote
 
joshuafandango@dsl.pipex.com
Guest
Posts: n/a
 
      12th Mar 2008
Cheers Jim, I'll give it a go in a bit.

On 6 Mar, 14:53, "Jim Rech" <jrr...@live.com> wrote:
> 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<joshuafanda...@dsl.pipex.com> wrote in message
>
> news:2e7496cc-1b79-47c7-807a-(E-Mail Removed)...
> | 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.


 
Reply With Quote
 
joshuafandango@dsl.pipex.com
Guest
Posts: n/a
 
      13th Mar 2008
Thanks again JR - it worked great.

Cheers,
JF
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drag and drop text in userform text / combo boxes Roger on Excel Microsoft Excel Programming 1 22nd Nov 2009 11:34 AM
Auto-expand/rich auto-complete option in Excel combo boxes Keith Howard Microsoft Excel Programming 1 21st Mar 2009 04:16 PM
Drop down combo boxes =?Utf-8?B?S2V2aW4=?= Microsoft Access Forms 1 30th Mar 2007 02:57 AM
Using an IF/THEN from across 2 drop down (combo) boxes??? Jim Sharky Microsoft Excel Discussion 1 3rd Oct 2005 04:06 PM
drop down options other than combo boxes? snsyg Microsoft Excel Misc 2 22nd Jan 2004 09:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:53 PM.