Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Custom short cut menu

Posted on 2014-02-06
6
Medium Priority
?
307 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

604 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