Function MenuDis(MenuName, EnDis)
In a module put this:
Dim MyBar
Set MyBar = CommandBars(MenuName)
MyBar.Enabled = EnDis
MyBar.Visible = EnDis
End Function
On a form or where you like put this:
Private Sub Form_Close()
MenuDis "MenuMain", False
End Sub
Private Sub Form_Open(Cancel As Integer)
MenuDis "MenuMain", True
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.