Command bar properties
I created my command bar objects & set their ONACTION property in code but noticed that it is not populating with the function name I specified. Isn’t it supposed to?
Here’s what the offending code looks like
'places items onto the "Filter Toolbar"...
Public Function createToolbar()
Dim runButton As CommandBarControl
'a button to run an object...
Set runButton = CommandBars("Filter Toolbar").Controls _
.Add(Type:=msoControlButton)
With runButton
.caption = "&Run"
.Style = msoButtonCaption
.OnAction = buildSQL()
End With
End Function
I created my command bar objects & set their ONACTION property in code but noticed that it is not populating with the function name I specified. Isn’t it supposed to?
Here’s what the offending code looks like

'places items onto the "Filter Toolbar"...
Public Function createToolbar()
Dim runButton As CommandBarControl
'a button to run an object...
Set runButton = CommandBars("Filter Toolbar").Controls _
.Add(Type:=msoControlButton)
With runButton
.caption = "&Run"
.Style = msoButtonCaption
.OnAction = buildSQL()
End With
End Function