Detect status of dropdown in a combo box

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

Mark via AccessMonster.com

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
 
M

Marshall Barton

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top