news.bellnet.ca said:
I want to run the following code every time a form is loaded or unloaded,
without adding code to every form in my database. Any ideas?
DoCmd.ShowToolbar "NoMenu", acToolbarNo
I have just too many forms to add same code to all of them individually.
Why don't you just make the above menu the "main" menu bar....and it will
always show anyway.
You do NOT need to write code to show/hide menus....
Any form that needs a different, or special menu bar simply needs to have
that menu bar specified in the "other" tab of the properties sheet.
For all forms that "default" to your above example menu bar...simply leave
the setting blank..and all forms will show that menu bar.
Your mess here is that you are trying to write code to show/hide menu
bars..and if you do this correct...it is 100% automatic in ms-access, and NO
code is needed.
Try downloading and running the 3rd example at my following web site that
shows a hidden ms-access interface, and NO CODE is required to do
this....but just some settings in the start-up.
Check out:
http://www.members.shaw.ca/AlbertKallal/msaccess/DownLoad.htm
notice how menu bars change when you change forms...and all ms-access stuff
is hidden. This takes NO CODE!!!! So, take a look at the startup
settings..and then take a look at the forms "other" settings. You do NOT
need code here!!