Avatar of Tony
Tony
 asked on

On Mouse Move, On Mouse OUT.

Hi,
Ms-Access - Vba.

As you know, in the event On Mouse Move it is possible to trigger something.

I have an specific case where I need that when the mouse Move on a Control (Combo) another form is open, the form get the focus and the mouse is now on the new open form.  I can do that, very easy.

However, how can I simulate a On Mouse OUT event?   So when I move the mouse Out of the new open form the form is automatically close.

It is actually behaving like a menu, where you put the mouse on a control, the menu displays.  When you move the mouse out, the menu disappears.

Thank you..
Microsoft AccessVBA

Avatar of undefined
Last Comment
Dale Fye

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Daniel Pineault

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Tony

ASKER
Hi Daniel...under what trigger event(s) should I put the codes?
Daniel Pineault

The triggers are in the code itself.  The calling form's Detail Mouse_Move and the control's MouseMove.

Tony

ASKER
Ok.  I will try.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
SOLUTION
Daniel Pineault

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Tony

ASKER
ok.. I will check..
Dale Fye

Instead of using another form, you might want to consider using a shortcut menu.
You can use the Access Shortcut Tool to design custom shortcut menus which you can either assign to the ShortcutMenuBar property of a control (would require right click in the control) or can popup during the MouseMove event, something like:
Private Sub YourControlName_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Commandbars("yourCustomMenu").showpopup
End Sub

Open in new window

and with this, you don't have to worry about closing the popup.