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

Removing a custom context menu in Access 2013 leads to problems

Posted on 2014-12-19
Last Modified: 2015-01-06
I'm converting an old Access 2000 database to an access 2013 (.accdb format) database.
In the old mdb there was a simple custom context menu (two macros) which was assigned in the startup options of the database.
I've converted the database to the .accdb format.
I have gone onto the 'this database' options and changed the context menu to (default) and turned off the check box for using context menus, closed the database and opened it.  
The context menu does not appear when I right click the mouse   :-)

Now I opened the database, deleted the two macros which are no longer required and started the database.  The initial form shows  :-)   BUT I also get an error message that the macro can't be found  :-((((

Obviously I can just leave the macros in and everything works as I want but that is really silly.  Why can't I remove these unwanted macros ?
Question by:AndyAinscow
  • 6
  • 2
LVL 26

Expert Comment

ID: 40509785
BUT I also get an error message that the macro can't be found  :-((((
Clearly they are referenced in the code.
You didn't just fall off the turnip truck.
I take it you've already done a CTRL-F looking for the macro names in the entire project to see if they can be found?
And I take it that the autoexec macro -- if there is one -- DOESN'T reference these, or if it does, you've redacted the references?

What steps have you taken?
Have you CTRL-BREAKed at the error to get thrown into the IDE at the location of the error?
LVL 44

Author Comment

ID: 40510500
>>Clearly they are referenced in the code.

That is my problem.  They should not be and I can't find any reference to them in the code.  I can start access, then open the database with the shift key to prevent startup things running.  When I open the startup form by clicking it then no error message.  There is no autoexec macro.

In other words my code/form that runs on startup does not reference the macro.  I'm puzzled.

>>Have you CTRL-BREAKed at the error to get thrown into the IDE at the location of the error?

Please elaborate.
LVL 44

Author Comment

ID: 40510523
I've been casting my mind back - the DB was originally developed in access 95.
This custom menu was used as an overall context menu AND to replace the default access menu.  (eg. Staff had clicked the print menu option when on a form and obviously the form was printed - not the report that the print button on the form would fill and display).
Now the main menu in Access 2007 (and later) doesn't exist.  (Maybe this is the problem, not the context menu?)  I've checked the startup screen options and explicitly written (default) into both context menu and menu dropdown selectors.  No effect, I still get the error.

ps.  Pressing CTRL+break when I see the error message just dismisses the message box.
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

LVL 84
ID: 40510548
It's possible the shortcut menu was defined in one or more of your forms, in the Other tab. Check the ones you have open when the error occurs to determine this ...

Now the main menu in Access 2007 (and later) doesn't exist.
Is is supposed to be there? Not sure ...
LVL 44

Author Comment

ID: 40510665
Just one form open
No context menu set for the form.

>>Is is supposed to be there? Not sure ...
Everything is over the ribbon, no classical menu
LVL 44

Author Comment

ID: 40512450
Found the problem.
This DB had just the one form which I opened as a popup.  Just to test I changed that setting so I could use the ribbon.  Under the AddIns tab it had created the old menu - hence the error message when the DB was opened.
Now the problem is that the setting in the options for custom menu in 'this database' is totally ignored.
optionsI can even enter a non existant macro name, close the DB and reopen it and the original custom menu is displayed.

This is really looking like a bug.
LVL 84

Accepted Solution

Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40512586
Could also be corruption in the database. Make a backup, then try this:

1. Compact the database
2. Compile the database - to do that, open the VBA Editor and click Debug - Compile. Continue doing this until the menu item is disabled
3. Compact again.

You might also need to Decompile the database. To do this, create a shortcut with this as the Target:

"full path to msaccess.exe" "full path to your db" /decompile

Run that, then run the 3 steps again.

Finally, you might consider moving everything to a new, blank database.

Also be sure your Windows and Office installations are fully up to date.
LVL 44

Author Comment

ID: 40512702
I've already tried compact/repair and decompiling in the VBA editor.
I had just created a new blank DB and imported everything (except macros).  That is probably less effort than trying to track down and 'repair' it manually.  (I've got about 20 DB's in total to get working)
LVL 44

Author Closing Comment

ID: 40535057
I decided to make new blank databases and import all objects/relations except for the macros/custom menus

Everything works fine (allowing for the ribbon being a ******* pain.  Microsoft, please please make it easy for developers to MODIFY THE F*****G thing.)

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

This article will show you how to use shortcut menus in the Access run-time environment.
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

840 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