Hide Access Menu

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hey all,
I created a nice program and now I want to hide the menubar when the user
opens it to avoid any confusion.
I have been through unchecking the Allow menu options in the Tools|Startup
options and the best that I could achieve still has a stripped down Menubar
with File|Edit|Insert... etc.
I tried creating an autoexec macro that calls NoMenu()

Function NoMenu()
CommandBars("Main Menu").Enabled = False
End Function

...to no avail.
Is there some other way that I am missing to accomplish this??
 
TimT said:
hey all,
I created a nice program and now I want to hide the menubar when the user
opens it to avoid any confusion.
I have been through unchecking the Allow menu options in the Tools|Startup
options and the best that I could achieve still has a stripped down Menubar
with File|Edit|Insert... etc.
I tried creating an autoexec macro that calls NoMenu()

Function NoMenu()
CommandBars("Main Menu").Enabled = False
End Function

..to no avail.
Is there some other way that I am missing to accomplish this??


Try this:
DoCmd.ShowToolbar "Menu Bar", acToolbarNo
 
Thanks Marshall,
Actually I tried that one too, but maybe I'm doing it wrong.
I created a function in Module1

Function HideMenu()
DoCmd.ShowToolbar "Menu Bar", acToolbarNo

End Function

Then, right below it I wrote

Private Sub NoMenu()
Call HideMenu
End Sub

I created a macro called autoexec
and choose RunCode and NoMenu() for the function name.
...do I have that right? or is there another way to do this because if I have
the database open (Shift+ open) and run the macro manually the menu hides
completely but if I just open the database normally it doesn't work.
What am I doing wrong??
Any help would be greatly appreciated.
 
There is no reason for the NoMenu function, especially if
it's Private. A macro, or anything else, can call the
HideMenu function directly. Actually, Idon't see how the
macro can work at any time because of the Private
declaration. Maybe this is the problem??

OTOH, maybe the AutoExec macro is too soon to do this. If
you have a startup form, try calling the HideMenu procedure
from the startup form's load event.
 
When I open the database Exclusively (or holding down the shift key) and
then I run the macro - it works great, hiding everything - toolbars, menus..
etc.. but when I launch it normally even with none of the startup options
picked and I run the macro it doesn't work at all. What gives with this?


Marshall Barton said:
There is no reason for the NoMenu function, especially if
it's Private. A macro, or anything else, can call the
HideMenu function directly. Actually, Idon't see how the
macro can work at any time because of the Private
declaration. Maybe this is the problem??

OTOH, maybe the AutoExec macro is too soon to do this. If
you have a startup form, try calling the HideMenu procedure
from the startup form's load event.
--
Marsh
MVP [MS Access]

Actually I tried that one too, but maybe I'm doing it wrong.
I created a function in Module1

Function HideMenu()
DoCmd.ShowToolbar "Menu Bar", acToolbarNo
End Function

Then, right below it I wrote

Private Sub NoMenu()
Call HideMenu
End Sub

I created a macro called autoexec
and choose RunCode and NoMenu() for the function name.
..do I have that right? or is there another way to do this because if I have
the database open (Shift+ open) and run the macro manually the menu hides
completely but if I just open the database normally it doesn't work.
 
I don't know what's up with that. As I said before,
AutoEcec may be too soon. Try calling the function from the
startup form's Load event.
 
Back
Top