I wanted to build a toolbar function in the form, but after clicking on the button, in the form of an arrow, the error says that no such function exists. Where could the error be ?
Private Function ToolbarWar()
Dim cbr As Object
Dim cbb As Object
' msoBarTop = 1
Set cbr = CommandBars.Add(Name:="ToolbarWar", Position:=1, Temporary:=True)
Set cbb = cbr.Controls.Add(Type:=1, Temporary:=True)
With cbb
.Caption = "My Button"
.FaceId = 41
.Width = 60
.FontSize = 250
.OnAction = PRR
End With
End Function
Private Function PRR()
DoCmd.Close
End Function
Private Function ToolbarWar()
Dim cbr As Object
Dim cbb As Object
' msoBarTop = 1
Set cbr = CommandBars.Add(Name:="ToolbarWar", Position:=1, Temporary:=True)
Set cbb = cbr.Controls.Add(Type:=1, Temporary:=True)
With cbb
.Caption = "My Button"
.FaceId = 41
.Width = 60
.FontSize = 250
.OnAction = PRR
End With
End Function
Private Function PRR()
DoCmd.Close
End Function