Curious Question

ShaneMan

Registered User.
Local time
Today, 02:04
Joined
May 9, 2005
Messages
1,224
I started a thread on another website but haven't gotten any takers,yet, so I thought I would post the same question here to see if someone wants to take a stab at my question.

I found this code on UA (below), sometime back, that allows me to disable all Menus and Toolbars and the function does work. I have a separate cmdButton that will set them all back to 'True' for when I am working in design view, but it only sets them back to 'True' on the particular db I am working on. If I open a separate db (like looking at someone's attachment here) I always have to add a cmdButton and run the function to set all Menus and Toolbars to 'True'. Why is that? It would seem to me if I click the button in any db to set them back to 'True' then that would affect every db.

TIA,
Shane

Code:


' Disable all Menus and Toolbars
Dim i As Integer

For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i
 
Not really sure what your problem is; the code you posted doesn't have that effect when I use it, in Access 2003(SP2.) What version are you running? Have you checked this against another of your own databases? Is it possible that the attachments you open from a post here don't just coincidentally have the menus turned off?
 
Not really sure what your problem is; the code you posted doesn't have that effect when I use it, in Access 2003(SP2.) What version are you running? Have you checked this against another of your own databases? Is it possible that the attachments you open from a post here don't just coincidentally have the menus turned off?

My version is 2000. This has been happening for over a year now but I just never posted anything. I do have older db that I created several years ago, that do not have this function in them, and when I go to refer to them, I run into this problem and have to create a cmdButton with the function behind it to get the menu's and toolbars to come back. Your the only one that has even responded so this is starting to look like something that is unique to me and my set up.

Thanks for your response,
Shane
 
I think this is not an issue with newer versions of Access. What I would do in your case is to add a hidden form to your application (if you don't already have one) that opens at start up. When that form opens, have it run the code to remove the menus and when it closes, have it restore the defaults. Hopefully, this will prevent the carryover to other applications.
 
I think this is not an issue with newer versions of Access. What I would do in your case is to add a hidden form to your application (if you don't already have one) that opens at start up. When that form opens, have it run the code to remove the menus and when it closes, have it restore the defaults. Hopefully, this will prevent the carryover to other applications.

Hey Ms. Pat,

Thanks for tossing in on this. The kick in the pants is, that is what I am already doing. When I came across this code the guy that wrote it gave the advise of doing just that so it's been set up that way from the start. I know before I did this all worked as it should. It can be frustrating cause when I go to do maintenance on my BE then I have to add one form with a cmdButton behind it to fire the code and get the menu's and toolbars going.

Thanks again,
Shane
 
Maybe it's time to upgrade :) I never liked A2K anyway.
 
I started a thread on another website but haven't gotten any takers,yet, so I thought I would post the same question here to see if someone wants to take a stab at my question.

I found this code on UA (below), sometime back, that allows me to disable all Menus and Toolbars and the function does work. I have a separate cmdButton that will set them all back to 'True' for when I am working in design view, but it only sets them back to 'True' on the particular db I am working on. If I open a separate db (like looking at someone's attachment here) I always have to add a cmdButton and run the function to set all Menus and Toolbars to 'True'. Why is that? It would seem to me if I click the button in any db to set them back to 'True' then that would affect every db.

TIA,
Shane

Code:


' Disable all Menus and Toolbars
Dim i As Integer

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



IMHO, I think the problem is your code. You should not be using this:

Code:
CommandBars(i).[B]Enabled[/B] = False

See the replies to your original post:
Curious question about this function

There are multiple post about this at UA.
 

Users who are viewing this thread

Back
Top Bottom