Solved

Custom short cut menu

Posted on 2014-02-06
6
304 Views
Last Modified: 2014-04-22
I have a maximized form that is in a databsheet view.  I want the user to be able to close the form because the tabs are not showing. How can I make it so that if the user clicks on the right mouse button there is only one option: Close?  Thanks.
0
Comment
Question by:Sasha42
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 85
ID: 39840726
What version of Access are you using? Versions before 2007 made it quite simple to create a right-click menu, but 2007 or newer is quite different.
0
 

Author Comment

by:Sasha42
ID: 39895984
I am using 2007.  Thanks for your help.
0
 
LVL 85
ID: 39897039
Essentially you create a custom macro group that includes the commands you want the user to see, and then you "call" that macro in the Form's "Shortcut Menu" property. This will supplant the default Access right click menu, and you can include only those items you want the user to see.

See this article for more information:

http://office.microsoft.com/en-us/access-help/create-custom-menus-and-shortcut-menus-by-using-macros-HA010282509.aspx
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 75
ID: 39897570
fwiw ... a new tool (Access Add In) is being developed as we speak that will replace the <=A2003 Customize Dialog. It will allow creating new commandbars (menus & right click  menus) as well as edit existing commandbars. It will also have several features not present in the original Customize Dialog, including importing selected commandbar elements from other dbs.

No coding will be required ...

mx
0
 

Author Comment

by:Sasha42
ID: 39898829
Can you show me what the vba code would look like?  I use code instead of macros. Thanks!
0
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 39899071
Essentially you do this:

strCBarName = "MyNewPopupMenu"
Set cbrCmdBar = Application.CommandBars _
   .Add(Name:=strCBarName, Position:=msoBarPopup)

From here: http://msdn.microsoft.com/en-us/library/office/aa140930(v=office.10).aspx

Once you do that, you can then set the form's Shortcut menu to whatever you've named the popup.

Obviously you'd want to add items to that. The article here shows how to do that:

http://msdn.microsoft.com/en-us/library/office/aa163587(v=office.10).aspx

Note too the links on those pages in the "See Also" section - there are a LOT of links that show how to do various things with commandbars.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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…

724 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