Getting rid of the menu bars

GregSmith

Registered User.
Local time
Today, 14:59
Joined
Feb 22, 2002
Messages
126
I have a mdb that opens up and loads my form. What I would like to do is get rid the MS Access toolbars. Is there away to do this??
 
This is one case where you would like to look into macros. There is one (ShowOrHideToolbars I believe that does just that). You would write a macro hiding the various built-in toolbars and call it autoexec...
 
This will allow you to hide and unhide all tool bars and menus.

'Put this in your forms OnOpen event:
Dim I As Integer
For I = 1 To CommandBars.Count
CommandBars(I).Enabled = False
Next I

'Put this in your forms OnClose event:
Dim I As Integer
For I = 1 To CommandBars.Count
CommandBars(I).Enabled = True
Next I

An added bonus is the right click option is disabled if the menu bars are disabled with this code.

HTH
 
Is there a way to display ONLY a custom toolbar? I would like to create a toolbar of just sort and filter functions and only have that display. Thanks!!
 
Use my code above to hide all toolbars and use this to show your custom toolbar...

DoCmd.ShowToolbar "YourCustomToolbarNamehere", acToolbarYes

HTH
 
ghudson:

THANKS!!! I will note this code for future use MANY times!!

Tom
 
ghudson:

Can you clarify one additional thing for me? I have one form database form that is the default open form... that I have tagged an Open event of a macro that maximizes the form. Is there a way I can maximize the form on open and run the open code that opens my toolbar?

The toolbar I have is called "ICAN toolbar." Could you help with the code on combining these open events? THANKS!!!

Tom
 
ghudson,

Oh MY Gosh! How do I get them back?

Carolyn
 
I guess I should mention that I put this code on the switchboard and so it has effected all the forms. reports, EVERYTHING! I'm not sure how I am going to make changes to the DB without them. Thank you.

Carolyn
 
vangogh228,

Put this in the main forms OnOpen event to hide all tool bars and menu bars, maximize the form and show your custom "ICAN toolbar" tool bar...

Dim I As Integer
For I = 1 To CommandBars.Count
CommandBars(I).Enabled = False
Next I
DoCmd.Maximize
DoCmd.ShowToolbar "ICAN toolbar", acToolbarYes

HTH
 
Carolyn,

I normally use security so I test for the current users workgroup name and hide or unhide the tool bars as needed. Or you could add the unhide all tool bars code to a command button of your choice. I prefer to add a double click event to a forms label to unhide the tool bars in a non secured db. That is my trick to unhide the tool bars since the users are not going to double click a label.

If CurrentUser = "programmer" Then 'unhide all tool bars and menu bars
Dim I As Integer
For I = 1 To CommandBars.Count
CommandBars(I).Enabled = True
Next I
Else 'hide all tool bars and menu bars
Dim I As Integer
For I = 1 To CommandBars.Count
CommandBars(I).Enabled = False
Next I
End If

HTH
 
Thank you ghudson,

I like that idea a lot. I did search the archives and found that if you hold down on the shift key while opening the DB it bypasses all the startup options. Whew! Have a great day:)

Carolyn
 
show/hide tool bars example db

I have attached a sample db that has two forms. Each uses a different method to hide or show all tool bars and menu bars. The db also has a custom tool bar and menu bar. There is one public module with the code to hide or show all tool bars where appropriate.

HTH those in need!
 

Attachments

Users who are viewing this thread

Back
Top Bottom