How detect click of down-arrow in combo box ?

G

Guest

I need to detect the click of the drop-down in a combo box.
I need to display a message "no selections available" if the contents of
another combo box are a certain value.
I DO NOT want this message displayed if the user just clicks inside the
combo box area.
Any tips?
 
K

Ken Snell \(MVP\)

Don't know of a way to do it directly. But you could put a transparent
command button on top of the dropdown arrow and have that button set the
focus to the combo box and drop down the list:

Private Sub CmdButton_Click()
Me.ComboBoxName.SetFocus
Me.ComboBoxName.Dropdown
MsgBox "you clicked the arrow"
End Sub

In the above code, I am using the MsgBox to show how you can "know" that the
click was on the arrow -- obviiously, you can replace that line of code with
whatever you want to have happen in that case.
 

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