COMBOBOX

Résolu/Fermé
amram.a Messages postés 56 Date d'inscription dimanche 19 mars 2017 Statut Membre Dernière intervention 19 avril 2017 - Modifié le 29 mars 2017 à 22:00
amram.a Messages postés 56 Date d'inscription dimanche 19 mars 2017 Statut Membre Dernière intervention 19 avril 2017 - 30 mars 2017 à 19:26
Bonjour,

j'ais fais 2 userforms dont enregistrement et consultation

dans consultation, j'aimerais que quand je sélection le code d'un membre, le reste des informations rempli automatiquement
mais tous remplis parfaitement sauf
l'image

voici d'abord le code que j'ais mis dans l'userform enregistrement :

Private Sub CommandButton2_Click()
Dim fichier As String

image_path = Application.GetOpenFilename(FileFilter:="Picture Files (*.gif;*.jpg;*.jpeg;*.bmp),*.gif;*.jpg;*.jpeg;*.bmp", Title:="Choisir image", MultiSelect:=False)
If image_path <> False Then
Image1.Picture = LoadPicture(image_path)
Image1.Visible = True
Var = TextBox1.Text
savepicture Image1.Picture, ThisWorkbook.Path & "\" & "MEMBRE " & Var & ".jpg"
End If
End Sub


voici aussi le code que j'ais mis dans l'userform consultation:


If Dir(ThisWorkbook.Path & "MEMBRE " & "\" & ComboBox1 & ".jpg") = "" Then
Me.Image1.Picture = LoadPicture("")
Else
Me.Image1.Picture = LoadPicture(ThisWorkbook.Path & "\" & "MEMBRE " & "\" & ComboBox1 & ".jpg")
End If

End Sub



mais l'image n’affiche pas dans l'userform consultation

2 réponses

f894009 Messages postés 16904 Date d'inscription dimanche 25 novembre 2007 Statut Membre Dernière intervention 18 mars 2023 1 678
30 mars 2017 à 07:40
Bonjour,

Pas de balise code volontairement
Regardez ce qui est en caracteres gras:
If Dir(ThisWorkbook.Path & "MEMBRE " & "\" & ComboBox1 & ".jpg") = "" Then
Me.Image1.Picture = LoadPicture("")
Else
Me.Image1.Picture = LoadPicture(ThisWorkbook.Path & "\" & "MEMBRE " & "\" & ComboBox1 & ".jpg")
End If
0
amram.a Messages postés 56 Date d'inscription dimanche 19 mars 2017 Statut Membre Dernière intervention 19 avril 2017
30 mars 2017 à 19:26
merci f894009 ça marché
0