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

Hide toolbars and exit button? 1

Status
Not open for further replies.

shart00

Technical User
Jun 16, 2003
63
US
I did a search and couldn't find exactly what I was looking for. Sorry if this has already been answered.

Is there a way to hide the toolbars at the launch of a form? I also want to hide the exit/minimize buttons. I've already set the min/max buttons to "none" but I want to hide the actual Access exit buttons too or at least ask the operator a question when they click on it. Any help would be appreciated.

Shawn
 
Checkout the options in Tools/Startup if you always want to hide this kind of stuff all the time.


In code, try this sort of thing:

currentdb.Properties("AllowBuiltinToolbars") = false

currentdb.Properties("AllowFullMenus") = false
 
Thanks. I got some of it to work in the tools/startup but I want to hide the menubar (File, edit, etc.) and the X button (exit) button too. Anyway to do that through code? I tried the following but got a unexpected error occured.
I put this code in on the form open event.

docmd.maximize
menubar.visible = false

Stll doesn't work yet. I'll keep playing with it.
 
You need to tell access which menu bar you want to hide.
What I do is create a blank menubar and assign it to the form (on the form properties-Other dialog) then on startup use
CommandBars("mnuMain").Enabled = False

where mnuMain is the name of my menu.

hth

Ben

----------------------------------------------
Ben O'Hara "Where are all the stupid people from...
...And how'd they get so dumb?"
rockband.gif
NoFX-The Decline
----------------------------------------------
 
There is also the undocumented switch =0 (equal sign zero) which if you place on the "MENUBAR" property of a form, will turn off the default Access main menu bar when the form opens. And if by magic, the menu bar reappear when you close the form.

Also, if you open the form, close any unwanted toolbars (like form design, formatting, etc) and the press Control/S, the form's "environment" will be saved, and next time you open it, those toolbars will not be visible...


Jim

Don't be sexist - Broads hate that.
Another free Access forum:
More Access help stuff at
 
Excellent! I got it by adding the custom menubar (instead of toolbar). However, now I'm trying to hide the Access exit button (Big ole X in the top right corner). Anyone know how?
 
shart00,
check the FAQs for a way to disable this. Unfortunately, I don't remember exactly where it is, but the general method is as follows:

1) When the database opens, open a hidden form, and set a global variable to false.
2) When the hidden form goes to exit, check the global variable. If false, cancel the exit. Because Access cannot close this hidden form, Access will not close either.
3) When you are ready to exit, set the global variable to true. This will allow the hidden form to close and Access to exit.

I use this frequently. When I have more time, I'll find the FAQ and provide a link.
 
Well this one i know a little about so her it goses.
1.Click tools on your menu bar and then click startup. the startup dialog box will open. Here if you have a swicthboard in place you can click the display form/page list arrow and then click swicthboard, this will make the swicthboard open on start up of the data base.
2.Now remove the check mark from the display database window buy clicking on it. this will stop the database window from opening on start up.
3. Click the Allow Full Menus check box to remove the check mark. this will enable the user from changeing the desing of the objects in the database. on a subset of built-in menus will be available.
4. Now remove the check mark from Allow Build-In Toolbar, this will complety eliminate the toolbars from all windows in the database.
(Just a little bit more [smile]
5. Now click the Allow Toolbar/Menu Changes to remove the check mark. this will prevent users from customizing toolbars,shortcut menus and menu bars.
6. Click the OK button to close the startup dialog box.
Let me tell you one thing i have learened is you had better keep your users from the back side of the database or you will have a BAD day.
FLOYD
 
I was mistaken. The code I was looking for is not in a Tek-Tips FAQ. It can be found at (another great Access resource).

This code is wonderful. I use a variation of it in most of my databases. Disabling the close button was one of my most commonly requested features.
 
If you want to totally hide the X button, set the Border Style property of your form to None. Then, if needed create custom borders.
 
Using my way, there is no cross to hide, but that's a gui issue for you to decide.
Just so you know, which ever way you implement you won't be stop the users pressing ctrl + F4 to close the form unless you also implement Korngeeks solution.

Ben

----------------------------------------------
Ben O'Hara "Where are all the stupid people from...
...And how'd they get so dumb?"
rockband.gif
NoFX-The Decline
----------------------------------------------
 
Hi

I've just unchecked all the startup option in the startup box like the guy said above. Now when i start all the toolbars have gone which is good.

There is probably a simple solution, but how do you bring up the properties box back up again?? I can't view any of my queries forms etc.

I'm quite stuck.

Thanks

 
Try holding down the shift key when you click the database to open it. It should then restore the menubars.
 
You can also review the code that I posted in the following thread: thread702-831433 which actually removes the control box from the Access window and subsequently will restore it when you're ready. It also has the added benefit of allowing you to change the Caption of the Main Access Window.

Good Luck
--------------
To get the most from your Tek-Tips experience, please read FAQ181-2886
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top