Link to home
Start Free TrialLog in
Avatar of João serras-pereira
João serras-pereiraFlag for Portugal

asked on

right-click on a ms/access 2013 field

I need to open a form if the user right-clicks  on a field. How do I do it?
Can anyone help?
Avatar of Rgonzo1971
Rgonzo1971

Hi,

You could use the MouseUp Event

MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

And test if Button = acRightButton '2

Regards
The right click is generally reserved for shortcut menus.

You might consider the double click event, or even add a button to the right of that control.
Avatar of João serras-pereira

ASKER

But how do I use it? Like that?:

Dim Btn As Integer, _
        Shift As Integer, _
        X As Single, _
        Y As Single
       

    mouse = Fld_F41a_EmpreendedorNUIT.OnMouseUp(Button, Shift, X, Y)
   
    If Buttin = acRightButton Then
        MsgBox "A"
    Else
        MsgBox = "B"
    End If
Just a comment here...
Opening a form on a right click creates non-standard functionality.
Can we ask what is the need for doing this?
Sure!

Sorry to be so long replying. Actually it is not such a non-standard functionality. When we right-click, what we want is the system to show up some contextual information on the object that we right-click. This is why we use it to obtain specific contextual menus. My case is similar, although no a menu. It is a set of information (contextual) to the field I am selecting.

Anyway... I am still without an answer and already used the click and double-click.... The option to show the information on a form is simply because it is the simplest manner in ms/access...

Joao
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
give up
If "give up" means you give up, then why did you accept my answer?