Opposite of combo box .Dropdown method?

How about setting the focus to another control on the form? That should close the combo box just as if the user had moved the focus somewhere else on the form.


I was just dealing with this as well. The best I could come up with is below. It sends the ALT key twice, which closes the combobox without triggering an Undo or moving focus to another control.

SendKeys "%"
SendKeys "%"

I was dealing this this issue today, and after a lot of trial and error, I discovered that the following works beautifully in Access 2010:

With m_cboLookup
    .ListWidth = .ListWidth    ' Close combo box
    'If Len(strSearch) > 3 Then .Dropdown
End With

Essentially, you are just setting the list width to the existing list width, but the combo box is closed, presumably to prepare for redrawing at a different size.

Tags:

Ms Access