Sheets("Stock").Activate
On Error Resume Next
'ComboBox2.Clear
Me.stocktr.Enabled = False
Quantitetr = ""
catetr = "": stocktr = "": TextBox1 = ""
With ComboBox1
' .Clear
If CB_Pièce = "Entrez le code produit" Then
.AddItem "Du magasin": .ListIndex = 0: Exit Sub
End If
Dim i&
For i = 1 To UBound(TblInv)
If TblInv(i, 1) = CB_Pièce.Text Then
.AddItem TblInv(i, 5)
If catetr = "" Then catetr.Text = TblInv(i, 2)
If stocktr = "" Then stocktr = TblInv(i, 4)
If Me.OptionButton1 = True Then
If TextBox1 = "" Then TextBox1 = ""
ElseIf Me.OptionButton2 = True Then
If TextBox1 = "" Then TextBox1 = Format(TblInv(i, 9), "DD/MM/YYYY")
End If
End If
Next i
.ListIndex = 0
End With
Me.stocktr.Enabled = False
Quantitetr.SetFocus