Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Automatically open a drop down list

2 views
Skip to first unread message

LDMueller

unread,
Nov 12, 2007, 7:50:00 AM11/12/07
to
I was wondering if there was VBA code I could write so that when the focus is
on a combo box which has a drop down list that the drop down list would
automatically open so the user wouldn't have to click on the drop down arrow
to see the list.

Any guidance would be greatly appreciated!

Thanks!

John Spencer

unread,
Nov 12, 2007, 7:58:49 AM11/12/07
to
In the GotFocus event, you should need one line of code.

Private Sub Combo6_GotFocus()
Me.Combo6.Dropdown

End Sub

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.

"LDMueller" <LDMu...@discussions.microsoft.com> wrote in message
news:0C20349C-6D28-453A...@microsoft.com...

Stefan Hoffmann

unread,
Nov 12, 2007, 8:00:49 AM11/12/07
to
hi,

LDMueller wrote:
> I was wondering if there was VBA code I could write so that when the focus is
> on a combo box which has a drop down list that the drop down list would
> automatically open so the user wouldn't have to click on the drop down arrow
> to see the list.

I personally don't like such a behavior.

> Any guidance would be greatly appreciated!

Private Sub yourComboBox_GotFocus()

yourComboBox.DropDdwn

End Sub

mfG
--> stefan <--

LDMueller

unread,
Nov 12, 2007, 8:13:01 AM11/12/07
to
Perfect, Thank you!

LDMueller

"John Spencer" wrote:

> In the GotFocus event, you should need one line of code.
>
> Private Sub Combo6_GotFocus()
> Me.Combo6.Dropdown
>
> End Sub
>
> --
> John Spencer
> Access MVP 2002-2005, 2007
> Center for Health Program Development and Management
> University of Maryland Baltimore County

> ..

LDMueller

unread,
Nov 12, 2007, 8:14:03 AM11/12/07
to
Also perfect, Thank you!

LDMueller

Gary Walter

unread,
Nov 12, 2007, 8:16:43 AM11/12/07
to

"LDMueller" wrote:
>I was wondering if there was VBA code I could write so that when the focus
>is
> on a combo box which has a drop down list that the drop down list would
> automatically open so the user wouldn't have to click on the drop down
> arrow
> to see the list.
>
Hi LD,

In addition to John's sage advice,
in certain, particular situations I have
used below code to simulate "mouse-over"
, i.e., when user runs mouse over the
combobox, it automatically drops down,
and then dropdown disappears when cursor
goes ouside boundary of combobox.

for example, in the MouseMove event
of a combobox named "cmboLink"

Private Sub cmboLink_MouseMove(Button As Integer, Shift As Integer, x As
Single, y As Single)
Me!cmboLink.SetFocus
Me!cmboLink.Dropdown
End Sub

Used in the wrong situation I could imagine it would really *annoy*
your users though...

good luck,

gary


0 new messages