'*****Validation dans Base de Données***********************************
Private Sub b_validation_Click()
'If Me.nom = "" Then
' MsgBox "Saisir un nom!"
''Me.nom.SetFocus
' Exit Sub
'End If
Set Temp = Sheets("Data").[A:A].Find(Me.ComboBox1, LookIn:=xlValues)
If Not Temp Is Nothing Then
If Temp.Row <> Ligne Then
MsgBox "Ce Nom de Produit Existe déjà!"
Exit Sub
End If
End If
Ligne = Sheets("Data").[A65000].End(xlUp).Row + 1
'---- transfert base
With Sheets("Data")
.Unprotect Password:="0000"
.Cells(Ligne, 1) = Format(Me.TextBox1, "dd/mm/yyyy") 'A
.Cells(Ligne, 2) = Me.TextBox2 'B
.Cells(Ligne, 3) = Me.ComboBox1 'C
.Cells(Ligne, 4) = Format(Me.TextBox3, "# ##0.00 €") 'D
.Cells(Ligne, 5) = Me.TextBox4 'E
.Cells(Ligne, 6) = Me.TextBox5 'F
.Cells(Ligne, 7) = Format(Me.TextBox6, "# ##0.00 €") 'G
.Cells(Ligne, 8) = Format(Me.TextBox7, "# ##0.00 €") 'H
.Cells(Ligne, 9) = Format(Me.TextBox8, "# ##0.00 €") 'I
.Cells(Ligne, 10) = Format(Me.TextBox9, "# ##0.00 €") 'J
.Cells(Ligne, 11) = Me.Commentaire
.Cells(Ligne, 12) = Me.TextBox10
.Protect Password:="0000"
End With
Me.ComboBox1.SetFocus
Sheets("Data").[A3:L5000].Sort Key1:=Sheets("Data").[A3]
Ligne = Sheets("Data").[C:C].Find(Me.ComboBox1, LookIn:=xlValues).Row
'majChoixNom
nettoie 'procédure vide Contrôles
End Sub