Function PopUp_DelPosRecount(NamePopUpMenu$, KodPosition&, frmName$)
Dim MenuItem As Object
Dim cmb As Object
On Error Resume Next
Application.CommandBars(NamePopUpMenu).Delete ' Delete any existing popup menu.
With Application.CommandBars.Add(Name:=NamePopUpMenu, Position:=5, _
MenuBar:=False, Temporary:=True)
With .Controls.Add(Type:=1) ' создание меню
.Caption = "Удалить позицию"
.faceID = 536 'значок "крестик"
.OnAction = "=DeletePositionFromInvoice(" & KodPosition& & ",'" & frmName & "')"
End With
With .Controls.Add(Type:=1)
.Caption = "Перенумеровать позиции счета"
.faceID = 11 ' значок "нумерованый список"
.OnAction = "=RecountPositionInInvoice('" & frmName & "')"
End With
With .Controls.Add(Type:=1)
.Caption = "Повторить строку"
.faceID = 136 ' значок "нумерованый список"
.OnAction = "=CopyRowInvoice('" & frmName & "')"
End With
End With
Application.CommandBars(NamePopUpMenu).ShowPopup
' Display the popup menu.
On Error GoTo 0
End Function
|