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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Menu and Toolbar Question 1

Status
Not open for further replies.

ccepaulb

Technical User
Jan 29, 2004
89
US
I have created an application in Access that will be used by multiple people within my company.
What is the best way to turn off all menu bars and toolbars so the user can not monkey around with the file?
I tried a number of ways, but everything seemed to be specific to "my" Access set-up.
I'd like to have everything turn off when the file is open and then restore back to default when it is closed.

Any suggestions would be greatly appreciated!

Thanks, Paul
 
Hi ccepaulb,

Take a look at the options available under Tools > Startup > Advanced (but be careful not to shut yourself out).

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
Yes I looked there and it did turn some off, But some did not. When I opened a form, the menu bars came back.
Also, (unless I am confused)
The selections appear to have been made on "my" Access not the file, when I went back in to Access the menu and tool bars were changed.
 
Hi ccepaulb,

The options you choose should apply to the database and affect all users.

What do want to stop - the forms menu just allows form actions - no 'monkeying around'. You can also, if you wish, specify custom menu bars for individual forms.

Alternatively, you can explicitly disable any menus you want in code behind a startup form.


Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
Tony,

You mentioned...
"Alternatively, you can explicitly disable any menus you want in code behind a startup form."

Can you give me some more info on this or let me know where I might be able to research this option?

Thanks, Paul
 
Hi Paul,

If you have a form loading at startup (set in Tools > Startup) you should be able to put code in its Load Event like ..

[blue]
Code:
Application.CommandBars("Menu Bar").Enabled = False
[/blue]

If you don't have a Form, you can use an AutoExec macro to run a Function which does the same.

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
I tried putting the above code as an event procedure for when the form loads, but now it will not load up my switchboard form when I open the file.
The code seems to work fine, but it appears that it interferes with my auto load of the switchboard file at startup?
Also, I turned off (under view, toolbars) all my toolbars, but now when I go in to Access and open a different file the toolbars are still turned off.
I need to figure out a way to turn off all toolbars at startup and then turn them on again when I close the file.

Thanks, Paul
 
Hi Paul,

One thing at a time ..

If you have a switchboard which loads at startup, then you can put any code you want in its Load or Open Event. You don't need to set up any other construct.

If you change settings via View > Toolbars, they are Application settings unrelated to any database.

If you use the Database Startup settings or disable the menu in code it should only affect the database and you shouldn't need to worry about resetting on Close.

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
That's what I was suspecting.
I tried to put your reccomended code in the load event for the form [Application.CommandBars("Menu Bar").Enabled = False] but I kept getting this error "Microsoft Access cannot find the macro 'Application'".
 
Hi Paul,

I read your post several times before it hit me (I think).

In the Form's Properties, under the Events tab, the various events are listed. For each of these you have the optin to enter either a macro name or "[Event Procedure]". i think you must have put the code in that box and it has been interpreted as a macro name (which it can't find).

Change it to "[Event Procedure]" (from the dropdown) and then click on the ellipsis at the right. This will take you into the code editor and it is here that you enter the code.

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
That did it! Thank you again

Now if I want to do the same with the toolbars would it be
the same code just change "menu bar" to "Form Design" and/or would I need to change the Commandbars to toolbars?

Thanks, Paul
 
I got it to work, this is great, thank you very much!

-Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top