Combo boxes - can they be programmed to "undropdown"?

Hi experts,

I know that there is VBA code that will drop down a combo box - cboField.dropdown.

Is there a way to do the reverse action?  For example, if the combo box has been clicked, the list of contents of that dropdown will be displayed.  I then have a message box that comes up when an item in that drop down is selected.  I would like to close the drop down if possible.

I know that this question will probably baffle people as to why I need this, but it is much harder to explain why.

Regards

Terry
TerenceHewettAsked:
Who is Participating?
 
Jim Dettman (Microsoft MVP/ EE MVE)Connect With a Mentor President / OwnerCommented:

   SendKeys "%{DOWN}"

  if the combo is down will push it back up.

JimD.
0
 
MINDSUPERBCommented:
Can you elaborate further?

As I know when combo box got focus, the list drop down using "cboField.Dropdown" and when you select an item from the list, the dropdown closes. This already happens.

Sincerely,
Ed
0
 
Rey Obrero (Capricorn1)Commented:
<I would like to close the drop down if possible.>

you don't need any codes to close the drop down,  
the normal behavior of the combo box is to close the drop down box when an item was selected...
0
 
VTKeganCommented:
If you are stating that you want the combo to close before the message box comes up.  Make sure that your message box is being called in the AfterUpdate event of the combo box.
0
 
TerenceHewettAuthor Commented:
JimD, your solution was spot on.  Thank you very much.

Thanks also to all others who have posted their thoughts.  Its always much appreciated.

Regards

Terry
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.