Hidding and displaying a Menu Bar

  • Thread starter Afrosheen via AccessMonster.com
  • Start date
A

Afrosheen via AccessMonster.com

Thanks for reading this post.

I have a custom menu bar with File, Print, Print Preview, and Exit.

What I want to do is hide the menu bar when displaying Forms and display the
menu bar when I view the Reports

The menu bar is called myMenu.

Is there a way of doing this?
 
T

tina

you can set the menu bar so it doesn't open when you open the database, then
add it to the MenuBar property of each report, so it will open when a report
opens, and close when the report closes.

to hide the menu bar, open the database to the database window, then from
the toolbar select Tools | Customize... on the Toolbars tab in the dialog,
scroll down the list until you find MyMenu, then *uncheck* the box next to
it, and close the dialog.

to add the menu bar to a report, open the report in Design view. in the
report Properties box, go to the MenuBar property and select MyMenu from the
droplist.

hth
 
A

Albert D. Kallal

Afrosheen via AccessMonster.com said:
Thanks for reading this post.

I have a custom menu bar with File, Print, Print Preview, and Exit.

What I want to do is hide the menu bar when displaying Forms and display
the
menu bar when I view the Reports

The menu bar is called myMenu.

Is there a way of doing this?

The easy way without really any coding is to make a menu bar for the
application startup (that has the options you need for all forms).

You can also if you wish perhaps specify a menu bar for all forms, but the
above should do the trick anyway (and save you having to set the menu bar
for each form).

Then, for all reports, specify your report menu bar you have now.

The above is really about the best approach. Since if you try and use code
all over the place, you have code in forms, reports etc. that try to figure
out when to display the correct menu bar. If report is open and then it
minimized, then you need some code to run to hide/display etc. This becomes
VERY messy very fast.

So, just specify a menu bar in the application startup that will be used for
all forms,
and then in the forms "other" tab of the property sheet you can specify
the menu bar for your reports.

one more tip:


Make sure you simply right click and hide all of the toolbars in ms-access.
Then, the setting for the application menu bar will override the built in
menu bar (but, stray additional menu bars and tools displayed at development
time WILL REMAIN displayed when you deploy...so, make sure you un-check them
all except for the main access menu bar). Of course during development..you
ALWAYS hold down the shift key during startup to enable the built-in access
menu bar to allow you to develop your application.
 
J

Jack Leach

Make sure you have a reference set to Microsoft Office Object Library XX.0
and use the following line of code:

Application.CommandBars("YourMenuName").Visible = True

This is of course in conjunction with the previous posts from Tina and Albert.

--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top