Link to home
Start Free TrialLog in
Avatar of AndyAinscow
AndyAinscowFlag for Switzerland

asked on

Removing a custom context menu in Access 2013 leads to problems

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 ?
Avatar of Nick67
Nick67
Flag of Canada image

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?
Avatar of AndyAinscow

ASKER

>>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.
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.
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 ...
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
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.
User generated imageI 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.
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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)
Thanks.
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.)