Hide menus is Global?

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
 

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