Solved

right-click on a ms/access 2013 field

Posted on 2015-02-09
8
116 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 49

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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

786 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