Article ID: 193167
Article Last Modified on 1/23/2007
.OnAction = "=<function name>()"
.OnAction = "<function name>"
Option Explicit
Sub Test()
Dim MBar As CommandBar
Dim MBarItem As CommandBarControl
Set MBar = CommandBars.Add(Name:="Test Bar")
MBar.Visible = True
Set MBarItem = MBar.Controls.Add(Type:=msoControlButton)
With MBarItem
.Caption = "Test"
.Style = msoButtonCaption
.OnAction = "=RunMe()"
End With
End Sub
Function RunMe()
MsgBox "You pressed a toolbar button!"
End Function
Test
Additional query words: the expression you entered has a field control or property name that Microsoft Access can t find
Keywords: kbbug kberrmsg kbpending KB193167