Disable the right click context menu of a textbox in Access/VBA

Posted on 2011-10-12
Last Modified: 2012-05-12
Hi there.

I've written a little bit of code which displays a custom right-click popup menu in a textbox in Access (2003).  The only problem I have is that, when I've selected the menu item from the popup and my code behind that has run, the 'normal' right click context menu appears, and I don't want it to.

Does anybody know how I might either disable this or use VBA to stop it from happening in the first place?

Question by:2toria
    LVL 119

    Accepted Solution

    can you try setting the FORM's  shortcut  Menu property to No, if you have not done yet..
    LVL 47

    Expert Comment

    by:Dale Fye (Access MVP)
    How are you calling your custom popup? with the MouseUp or MouseDown event?

    If you set the shortcut menu bar property of that textbox to the name of your shortcut menu, it should prevent the standard rightclick menu from popping up.
    LVL 8

    Author Closing Comment

    Great stuff - that worked perfectly thanks!!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
    My experience with Windows 10 over a one year period and suggestions for smooth operation
    In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
    The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now