Detect status of dropdown in a combo box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a combobox on a form which automatically expands using the dropdown
method on the combobox's MouseMove event. I want to close the dropdown as
soon as the mouse is moved away. I'm trying to do this in the
Details_MouseMove Sub. Is it possible to check a combobox drop down status,
or do I have to somehow move the focus away, which will automatically close
the box? (However, I'd like the focus to remain on the combobox after the
dropdown box has closed.
 
Try creating a box around the combo box, with transparent border style (to
hide it). For the mouse event of the box object, turn echo off so the
screen won't update, set the focus to some text box, set focus back to the
combo box and turn echo back on:

Private Sub Box2_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
DoCmd.Echo False
Me.Text3.SetFocus
Me.Combo0.SetFocus
DoCmd.Echo True
End Sub
 
Italian said:
I have a combobox on a form which automatically expands using the dropdown
method on the combobox's MouseMove event. I want to close the dropdown as
soon as the mouse is moved away. I'm trying to do this in the
Details_MouseMove Sub. Is it possible to check a combobox drop down status,
or do I have to somehow move the focus away, which will automatically close
the box? (However, I'd like the focus to remain on the combobox after the
dropdown box has closed.


I don't know, but maybe you have to move the focus to get
the dropdown to close up??

OTOH, maybe you can learn something from:
http://www.mvps.org/access/api/api0052.htm
 
Back
Top