Access 97 SR-1
Greetings
Some advice would be appreciated to point me on the way.
I am attempting to code a custom menu, my first such attempt.
The top Level on menu bar is to be CUSTOM
I want the next item to be SEARCH
The code bombs with Error 438, Object doesnt support this property or method
—————————————————-
Sub CustomMenu()
Dim cbr As CommandBar
Dim cbcCustom As CommandBarControl
Dim cbcSearch As CommandBarControl
Set cbr = CommandBars(“menu Bar”)
Set cbcCustom = cbr.Controls.Add(msoControlButton)
With cbcCustom
.Caption = “Custom”
.Tag = “Test Menu Item”
.Style = msoButtonCaption
End With
Set cbcSearch = cbcCustom.CommandBar.Add(msoControlButton)
With cbcSearch
.Caption = “Search”
.Tag = “search”
.Style = msoButtonCaption
End With
End Sub
——————————————-
CUSTOM sits very nicely on the Menu Bar even though it has bombed defining SEARCH.
Thanks in anticipation
G