show tool bar

peterbowles

Registered User.
Local time
Today, 08:00
Joined
Oct 11, 2002
Messages
163
if the start up option in the database window you uncheck all the options like

Allow full menus
allow default and shortcut menus

Etc

can you have a button to turn them on again
 
yes, this should be possible. I.e. with a toggle button.
Code:
Private Sub tglShowMenu_AfterUpdate()
  Me.ShortcutMenu = Me!tglShowMenu
End Sub
 
The below code will disable (hide) all menu bars and tool bars. Ensure that you have a way to enable (unhide) the menu bars and tool bars (transparent command button) before you hide them!

'this will disable all menu bars and tool bars
Dim i As Integer
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i

'this will enable all menu bars and tool bars
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 the above code.

Use the 'ShowToolbar' command if you need to display a toolbar...
DoCmd.ShowToolbar "YourToolBarNameHere", acToolbarYes

This will hide a toolbar when needed...
DoCmd.ShowToolbar "YourToolBarNameHere", acToolbarNo

You can also hide/unhide the database window with code...

'Hide the database window
DoCmd.SelectObject acTable, , True
DoCmd.RunCommand acCmdWindowHide

'Unhide the database window
DoCmd.SelectObject acTable, , True


HTH
 

Users who are viewing this thread

Back
Top Bottom