Trouble with Access 2003 main menu (Hide/Un-hide)

Danick

Registered User.
Local time
Today, 15:38
Joined
Sep 23, 2008
Messages
371
Not sure if this a bug or something wrong with my coding or where I call it.
I’ve been playing with VBA to hide the main menu. I’ve put this in my start form’s on-load event that gets called from an autoexec macro.

CommandBars.ActiveMenuBar.Enabled = False 'Turn Access Menu Bar off

This works fine and the main menu bar disappears. The problem is that after I exit the database and open any other database (databases where I do not want to hide the menu) the menu is also hidden. I even tried putting code on exiting the database to turn the menu back on but that didn’t work either.

CommandBars.ActiveMenuBar.Enabled = True 'Turn Access Menu Bar on

I do not understand why this code in one database would affect the menu bars in other databases. I thought maybe there was a problem with my Access program. But I copied the database to another computer and the same thing happens.

The only way to get it back is to either:

Press shift and launch the database. The menu bar is still hidden. Press Alt-F11 to go into the visual basic. Then right click on a Menu Bar and select Customize... highlight the Database menu bar and press the properties button. Press the Restore Defaults button.

The other way is to put this code in the load event of the start-up form

Dim i As Integer
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = True
Next i

This maybe fine for my own database as I know how to get the main menu bar back, but I can’t give the database to other users and mess up their computer.

Anyone have any experience with this? Am I doing something wrong? Or should I be calling up something completely different in order to hide the main menu. I've searched this forum and others and all seem to show that the VBA I put in the load event should work.


Thanks
Using Access 2003
 
Instead of using code, have you tried changing the Startup properties. Click Tools on the main menu, then select Startup. Untick the box "Allow Full Menus".
 
Instead of using code, have you tried changing the Startup properties. Click Tools on the main menu, then select Startup. Untick the box "Allow Full Menus".

Not sure if you could do this on other versions of Access, but the "Menu Bar" will continue to show no matter what you select in the Startup properties of Access 2003.

I've even tried going into the customize and cleared the Menu Bar from the list as well as unchecked the "Show full menus after a short delay" in the Customize - Options tab. I can not find any combination of check boxes to keep the Main Menu Bar hidden. At best, I can hide the Menu Bar by unticking the box in the Customize - Toolbar window, but it comes back as soon as you re-launch the application.

This is why I believe I need to hide the Menu Bar with code.
 
Rather than getting off the subject of whether or not to run code, would someone please test and let me know this simple question.

Put this code in the on-load event of a startup form in an Access 2003 database:

CommandBars.ActiveMenuBar.Enabled = False 'Turn Access Menu Bar off

Question: Will the computer that runs this code be stuck with no menus for all other Access 2003 databases?

I find that on my computers, the only way to get the menu bars back is to run the code I've included in my first post in the on-load event of the start-up form of an Access 2003 database.

If you do try this and your machine also gets stuck without menus, I've attached a small database that will turn your menus back on.

Thanks
 

Attachments

Well I haven't found a real solution to this problem yet. However, I have found a few threads in forums that show this to be a problem on other computers.
Here are a couple:

http://www.utteraccess.com/forum/Menu-Bar-Deactivated-t1956223.html

http://www.utteraccess.com/forum/Menu-bars-missing-t1271054.html

So I know that the problem existed. But since no has been complaining about in a while, I have to assume that they either stopped trying to use this code, found a way to fix it, or moved on from Access 2003.
 

Users who are viewing this thread

Back
Top Bottom