Automatically open a drop down list

G

Guest

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!
 
J

John Spencer

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
..
 
S

Stefan Hoffmann

hi,
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 <--
 
G

Guest

Perfect, Thank you!

LDMueller

John Spencer said:
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
..
 
G

Guest

Also perfect, Thank you!

LDMueller

Stefan Hoffmann said:
hi,

I personally don't like such a behavior.


Private Sub yourComboBox_GotFocus()

yourComboBox.DropDdwn

End Sub



mfG
--> stefan <--
 
G

Gary Walter

LDMueller said:
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
 

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