On both of these responses:
1. That's where I got the code to begin with.
2. I already have a reference to Microsft Access 11 object library MSACC.OLB
Note: The code to disable all commandbars works fine.
However adding a line:
Dim cbarMenu As CommandBar
will cause it to not compile.
I did notice some of the articles saying the Microsoft Access 11 object
library should reference a DLL where mine references "MSACC.OLB"
I'm guessing it is some kind of reference issue. I had reference issues
after installing Access2007 and had to uninstall it to get Access2003
working again.
Any further help you could provide???
Thanks in advance,
Mark
"Chris O'C via AccessMonster.com" <u29189@uwe> wrote in message
news:8ca78d9fd49e9@uwe...
> The commmandbars class is part of the office library. Add Microsoft
> Office
> xx.0 Object Library to your list of references and recompile. xx.0 is the
> version of office you have installed on your pc.
>
> Chris
> Microsoft MVP
>
>
> Mark Andrews wrote:
>>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
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...ccess/200811/1
>