M
Mark Andrews
I am trying to hide all menus except one custom menu.
This code hides all menus:
Public Function HideAllMenus()
Dim i As Integer
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i
End Function
This was my first attempt (it does not compile):
I get an error on the "Dim cbarMenu as CommandBar" line (user defined type
not defined). I have references to Microsft Access 11 object library
MSACC.OLB.
Public Function HideAllMenus()
'Hides all menus except RPTMenu
Dim i As Integer
Dim cbarMenu As CommandBar
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i
Set cbarMenu = CommandBars("RPTMenu")
cbarMenu.Enabled = True
End Function
Help,
Mark
This code hides all menus:
Public Function HideAllMenus()
Dim i As Integer
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i
End Function
This was my first attempt (it does not compile):
I get an error on the "Dim cbarMenu as CommandBar" line (user defined type
not defined). I have references to Microsft Access 11 object library
MSACC.OLB.
Public Function HideAllMenus()
'Hides all menus except RPTMenu
Dim i As Integer
Dim cbarMenu As CommandBar
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i
Set cbarMenu = CommandBars("RPTMenu")
cbarMenu.Enabled = True
End Function
Help,
Mark