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

Posted on 2011-02-17
Medium Priority
Last Modified: 2012-05-11
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.


Question by:TerenceHewett
LVL 19

Expert Comment

ID: 34916362
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.

LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34916378
<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...
LVL 10

Expert Comment

ID: 34916527
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.
LVL 59

Accepted Solution

Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 total points
ID: 34916583

   SendKeys "%{DOWN}"

  if the combo is down will push it back up.


Author Comment

ID: 34916749
JimD, your solution was spot on.  Thank you very much.

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



Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

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.

Join & Write a Comment

What to do if a split doesn't fit? Or a bunch of invoice lines must be rounded while the sum must match a total? It takes a little, but - when done - it is extremely easy to implement.
If you need to implement application level security in an Access database application or other VBA code, I strongly encourage you to take advantage of Active Directory groups.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

587 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question