Solved

Removing a custom context menu in Access 2013 leads to problems

Posted on 2014-12-19
9
191 Views
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 ?
0
Comment
Question by:AndyAinscow
  • 6
  • 2
9 Comments
 
LVL 26

Expert Comment

by:Nick67
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?
0
 
LVL 44

Author Comment

by:AndyAinscow
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.
0
 
LVL 44

Author Comment

by:AndyAinscow
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.
0
 
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 ...
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 44

Author Comment

by:AndyAinscow
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
0
 
LVL 44

Author Comment

by:AndyAinscow
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.
0
 
LVL 84

Accepted Solution

by:
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.
0
 
LVL 44

Author Comment

by:AndyAinscow
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)
0
 
LVL 44

Author Closing Comment

by:AndyAinscow
ID: 40535057
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.)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
My experience with Windows 10 over a one year period and suggestions for smooth operation
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.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

760 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

17 Experts available now in Live!

Get 1:1 Help Now