Combobox

Bonsoir a tous

jai un petit soucis enfin je trouve pas le code vba je veut afficher les désignation des article dans le choix d'article et quand je choisi un article il m'affiche les information dans le formulaire comme ca je peux modifier

merci d'avance

voila le ficher

22gestion.xlsm (23.54 Ko)

Bonjour,

Code pour l'UserForm pour remplir le ComboBox :

Private Sub UserForm_Initialize()

    Dim Plage As Range
    Dim T

    With Worksheets("Stock"): Set Plage = .Range(.Cells(6, 3), .Cells(.Rows.Count, 3).End(xlUp)): End With

    T = Plage

    Cmb_désignation.List = T

End Sub

Code pour le ComboBox :

Private Sub Cmb_désignation_Click()

    With Cmb_désignation

        Me.Txt_numéro.Value = Cells(.ListIndex + 6, 2).Value
        Me.Txt_désignation.Value = Cells(.ListIndex + 6, 3).Value
        Me.Txt_début.Value = Cells(.ListIndex + 6, 4).Value
        Me.Txt_min.Value = Cells(.ListIndex + 6, 8).Value
        Me.Txt_max.Value = Cells(.ListIndex + 6, 9).Value
        Me.Chemin.Value = Cells(.ListIndex + 6, 11).Value

   End With

End Sub

Salut Theze

ça fonctionne parfaitement mai juste un petit souci quand je choisi un article l'image n'affiche pas dans le formulaire

Bonjour,

Voici le correctif :

Private Sub Cmb_désignation_Click()

    With Cmb_désignation

        Txt_numéro.Text = Cells(.ListIndex + 6, 2).Value
        Txt_désignation.Text = Cells(.ListIndex + 6, 3).Value
        Txt_début.Text = Cells(.ListIndex + 6, 4).Value
        Txt_min.Text = Cells(.ListIndex + 6, 8).Value
        Txt_max.Text = Cells(.ListIndex + 6, 9).Value
        Chemin.Text = Cells(.ListIndex + 6, 11).Value
        If Dir(Chemin.Text) <> "" Then Image1.Picture = LoadPicture(Chemin.Text)

   End With

End Sub

Bonjour Theze

merci pour ton aide ça marche parfaitement

Rechercher des sujets similaires à "combobox"