1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| Private Sub CommandButton2_Click()
'https://www.youtube.com/watch?v=KaAsd8n1u98
'Double click Bouton Rechercher
If Not ComboBox1.Value = "" Then
Dim MonFichier As String
Dim MonBlason As String
Nom = ComboBox1.Value
MonFichier = ("C:\Users\Polo\Documents\Fiches Généalogie\Dossier Image Reines de France\") & Nom & (".jpg")
MonBlason = ("C:\Users\Polo\Documents\Fiches Généalogie\Dossier Image Reines de France\Blason\") & Nom & (".jpg")
Dim no_ligne As Integer
no_ligne = ComboBox1.ListIndex + 2
TextBox1.Value = Cells(no_ligne, 1).Value
ComboBox1.Value = Cells(no_ligne, 3).Value
TextBox2.Value = Cells(no_ligne, 4).Value
TextBox3.Value = Cells(no_ligne, 5).Value
TextBox4.Value = Cells(no_ligne, 6).Value
TextBox7.Value = Cells(no_ligne, 7).Value
Else
End If
If FichierExiste(MonFichier) = True Then
'MsgBox "Le fichier existe..."
Image1.Picture = LoadPicture(MonFichier)
Else
MsgBox "Le fichier image n'existe pas..."
Image1.Picture = LoadPicture
End If
If FichierExiste(MonBlason) = True Then
'MsgBox "Le fichier existe..."
Image2.Picture = LoadPicture(MonBlason)
Else
MsgBox "Le fichier image n'existe pas..."
Image2.Picture = LoadPicture
End If
End Sub |
Partager