Solved

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

Posted on 2011-02-17
5
354 Views
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.

Regards

Terry
0
Comment
Question by:TerenceHewett
5 Comments
 
LVL 19

Expert Comment

by:MINDSUPERB
Comment Utility
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
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
<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
 
LVL 10

Expert Comment

by:VTKegan
Comment Utility
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
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
Comment Utility

   SendKeys "%{DOWN}"

  if the combo is down will push it back up.

JimD.
0
 

Author Comment

by:TerenceHewett
Comment Utility
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

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now