Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2003 built-in Menu Bar fails to restore on a user's computer

Status
Not open for further replies.

greg32246

Technical User
May 21, 2009
19
US
Access 2003

At work we have a number of mini "applications" created in Access. Most of them do not have custom menus or toolbars, we just allow the built in ones. However, in one application, I am disabling all of the built in menus and toolbars for security reasons. I restore the built-in menus and toolbars when the application is closed.

This works fine on my computer. But, I have a user who is getting a different result. After she closes the application that disables the menus and toolbars, when she goes to open another Access application the MENU BAR is not visible. And it is just the MENU BAR. All of the other built-in toolbars are enabled, just not the MENU BAR.

On the affected computer, in one of the "other" applications, I just banged some code into a module and ran it to enable the MENU BAR. That worked to TEMPORARILY restore the MENU BAR. If I close that same application and then re-open it, the MENU BAR is not visible.

The only way I was able to permanently restore the MENU BAR on her computer was to go into the Customize Toolbars section (after I temporarily restored the MENU BAR using the code), select the MENU BAR from the list of toolbars and press the RESET button to restore the Access defaults.

The problem is, if she uses the application that hides the menus and toolbars again, we just wind up with the same problem.

Has anyone seen this problem before or have any suggestions as to how I might go about fixing this?

Thanks is advance.




Here is the code which runs on the Open event of my main menu form (switchboard) to disable the menus and toolbars:

Dim i As Integer

'disable all built in menus and toolbars

For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i

When the application is closed, I restore the built-in menus and bars using the following code in the Unload event of the same main menu form:

Dim i As Integer

'restore the built in menus and toolbars

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


 
I didn't get any responses, but I was able to come up with a work around in case anybody is interested.

I decided to nix the code that disables the built-in menus and toolbars and instead I created a custom menu bar that has no actual commands in it. Then I set the startup settings such that the Allow Built-in Toolbars box, Allow Full Menus, Allow Shortcut Menus, etc are all unchecked. Then I set the Menu Bar setting in the startup options to my custom menu bar. For the most part this gave me what I wanted, an application with no built-in toolbars and no built-in menu bar or shortcut menus.

This results in having an empty menu bar docked at the top of my application, which was not exactly what I was going for, since I wanted a cleaner look, but it is an acceptable trade-off. And it allows the changes to only affect this specific application since I am not manipulating application wide properties in the code, I am just setting the startup options specific to this database. So, the user can have multiple databases open at the same time without losing the ability to have the built-in menus and toolbars available to them in the other applications.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top