Solved

right-click on a ms/access 2013 field

Posted on 2015-02-09
8
119 Views
Last Modified: 2016-02-11
I need to open a form if the user right-clicks  on a field. How do I do it?
Can anyone help?
0
Comment
Question by:jirdeaid
8 Comments
 
LVL 50

Expert Comment

by:Rgonzo1971
ID: 40600162
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
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 40600570
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.
0
 

Author Comment

by:jirdeaid
ID: 40601520
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
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40602178
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?
0
 

Author Comment

by:jirdeaid
ID: 40611256
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
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 40611492
You might want to look into creating, or augmenting the right click menu (Form View Control) associated with the textbox, and add an option to that menu, or create your own right click menu for that control.

Check out my series of articles on right click (shortcut) menus, here.
0
 

Author Closing Comment

by:jirdeaid
ID: 40625136
give up
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 40625443
If "give up" means you give up, then why did you accept my answer?
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question