Automatically open a drop down list

  • Thread starter Thread starter Guest
  • Start date Start date
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!
 
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
..
 
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 <--
 
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
..
 
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 <--
 
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
 
Back
Top