Probléme de RechercheV avec userform

nops2904

XLDnaute Nouveau
Bonjour
voila j'ai un problème que je n’arrive pas à résoudre malgré es visite sur des tutos
j'ai un formulaire userform rechercheV mes un erreur 13 execution si quelqu'un pourrait me donner
un coup de main merci
 

Pièces jointes

  • Negoce Auto.xlsm
    245.3 KB · Affichages: 34

PMO2

XLDnaute Accro
Bonjour,
Essayez de changer le code de la procèdure Private Sub txtnom_AfterUpdate() de Formclient par le code suivant :
VB:
Private Sub txtnom_AfterUpdate()
Dim var As Variant
Dim i&
'---
If WorksheetFunction.CountIf(Sheets("Clients").Range("c:c"), Me.txtnom.Value) = 0 Then
  MsgBox " Ce client n'existe pas.veuillez resaisir un nouveau nom", vbInformation + vbOKOnly, "Client non trouvé"
  Exit Sub
End If
   
With Me
  var = Sheets("Clients").Range("Tableau1")
  For i& = LBound(var, 1) To UBound(var, 1)
    If var(i&, 3) = .txtnom Then
      .txtprénom = var(i&, 4)
      .txtadresse = var(i&, 5)
      .txtcp = var(i&, 6)
      .txtville = var(i&, 7)
     'etc...
      Exit For
    End If
  Next i&
End With
End Sub
 

Pièces jointes

  • Negoce Auto_pmo.xlsm
    236 KB · Affichages: 29

Statistiques des forums

Discussions
312 103
Messages
2 085 313
Membres
102 860
dernier inscrit
fredo67