Hiding menu bar on mde startup

  • Thread starter Thread starter Silvester
  • Start date Start date
S

Silvester

Hi,

I have my own custom menu bars that I use with my app.

I am trying to hide the default menu bar when my mde starts up by running
the code
DoCmd.ShowToolbar "Menu Bar", acToolbarNo
from a module function called by the autoexec macro on mde startup.

For some annoying reason this does not work, leaving the menu bar onscreen
for end users to meddle with. My custom menu bar appears below the default
menu bar.

Please let me know what I am doing wrong and how to ensure the menu bar is
hidden as soon as the app starts up.

TIA
 
try clicking Tools, Startup on the menu bar, then uncheck the Allow Full
Menus checkbox, and select your custom menu from the Menu Bar droplist.

hth
 
by doing what Tina suggested, you can still press ctrl F11 to toggle between the two menus.
 
true enough. to prevent that, you can uncheck the Use Access Special Keys
checkbox - also in Tools, Startup.
of course that only works as long as your users don't know enough to hold
down the Shift key to bypass the Startup settings. to prevent that, you have
to set the AllowBypass property to False - being careful not to change it
permanently!


Alex said:
by doing what Tina suggested, you can still press ctrl F11 to toggle
between the two menus.
 
Silvester said:
Thanks. A vba coding solution would be preferred

Why use VBA?

Try downloading the 3rd example at:

http://www.attcanada.net/~kallal.msn/msaccess/DownLoad.htm

It complete hides the ms-access interface, and no code at all is needed.

Give the above a try. Of course, for production I would distribute a mde,
and turn off the shift key by-pass...but other then that...no code at all is
needed...

You can use my shift-key utility at:

http://www.attcanada.net/~kallal.msn/msaccess/msaccess.html
 
Thank you. From what I can see, you have chosen your custom menu bar on app
startup options.

Hopefully this should do the trick
 
try this, you have to have the Office reference library for commandba
and commandbarcontrol.

Public Function CloseMnuItems() As Variant
Dim cbMenu As CommandBar
Dim cbC As CommandBarControl

Set cbMenu = CommandBars("Menu Bar")
cbMenu.Enabled = False

End Functio
 
Back
Top