Hide menus is global? - repost

R

redtux

Hi I have the following code attached to a sub to hide menuitems

DoCmd.ShowToolbar "database", acToolbarNo
CommandBars("Window").Controls("Hide").Visible = False
CommandBars("Window").Controls("Unhide...").Visible = False
CommandBars("Menu Bar").Controls("Tools").Visible = True

For Each cb In CommandBars("tools").Controls
If Not cb.Caption = "&Spelling..." And Not cb.Caption = "Office &Links" Then
cb.Visible = False
End If
Next cb

For Each cb In CommandBars("view").Controls
If Not cb.Caption = "&Form View" Then
cb.Visible = False
End If
Next cb


(I also have the reverse attached to another button)

Both work except for a major problem

Rather than only affecting only this database they affect all databases on
my login.

How do I explicitly set this to be only for this DB

thanks etc
 
A

Albert D. Kallal

If you do this correclty, you not need ANY code to hide the menu bars.

If you run a bunch of code to turn off the menus, it no differned then if
you use view->toolbars-...and hide/unhide menus.

You likey don't want to mess up a users machine that way...

You most certainly can, and should hide all of the ms-access interface. The
options to complete hide and keep people out of the ms-access interface can
easily be done using the tools->start-up options. Using those options allows
you to complete hide the ms-access interface (tool bars, database window
etc). Also, using these options means you do not have to bother setting up
security to keep users out of your stuff.

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

After you try the application, you can exit, and then re-load the
application, but hold down the shift key to by-pass the start-up options. If
want, you can even disable the shift key by pass. I have a sample mdb file
that will let you "set" the shift key bypass on any application you want.
You can get this at:
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html

Notice how in the above, i not used *any* code to hide the menus......
 

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