• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 371
  • Last Modified:

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
0
TerenceHewett
Asked:
TerenceHewett
1 Solution
 
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
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:

   SendKeys "%{DOWN}"

  if the combo is down will push it back up.

JimD.
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

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now