Pb With On Action Ussing Parameter

  • Thread starter Thread starter mickeyEsial
  • Start date Start date
M

mickeyEsial

Guest
Hi,
my pb si very simple :
i can't find the correct way to call a sub with 2 parameters in a "ONACTION":
Have a look :


Code:
Private Sub lstPers_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
 If Button = 2 Then
    ' pour la popup
    If Me.lstPers.ListIndex <> -1 Then
        Dim cb As CommandBar
        Dim cbc As CommandBarControl
        Set cb = CommandBars.Add(Name:="", Position:=msoBarPopup, MenuBar:=False, Temporary:=False)
        Set cbc = cb.Controls.Add(Type:=msoControlButton)
        With cbc
            .Caption = "Supprimer cette personne de la base"
            [B].OnAction = "suppPersonne ARG1,ARG2"[/B]        
End With

cb.ShowPopup
End If
End If

End Sub
 
Last edited by a moderator:
Try :
.OnAction = "=suppPersonne (ARG1,ARG2)"

BTW, what are ARG1 and ARG2, variables or constants values?

If you funtion suppPersonne is in a form, you might need to call it that way:
.OnAction = "=Forms!FormName.suppPersonne (ARG1,ARG2)"

Lâche pas!!!
 
Thats an old post... I don't think he will be checking on it anytime soon...
 

Users who are viewing this thread

Back
Top Bottom