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
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