Private Sub TBxQteAProd_AfterUpdate()
Dim ColQtéStock As Integer, QtéFab As Double, TDon(), TLBx(), N As Integer, L As Long, _
QtéStock As Double, QtéRequisePour1000000 As Double, QtéRequisePourFab As Double, LLBx As Integer
ColQtéStock = CLsA.Colonnes("Qté en stock/Magasins externes").Index
QtéFab = Val(Replace(TBxQteAProd.Text, ",", "."))
TDon = CLsA.PlgTablo.Value
ReDim TLBx(1 To UBound(TLigCompCol) + 1 - CMinComp, 1 To 5)
For N = CMinComp To UBound(TLigCompCol)
L = TLigCompCol(N): If L < 0 Then L = LCouA
If L > 0 Then QtéStock = TDon(L, ColQtéStock) Else QtéStock = -999.99
On Error Resume Next
QtéRequisePour1000000 = TDon(LCouA, N)
QtéRequisePourFab = QtéFab * QtéRequisePour1000000 / 1000000
If Err Then QtéRequisePour1000000 = 1
On Error GoTo 0
If QtéRequisePour1000000 > 0 Then
LLBx = LLBx + 1
TLBx(LLBx, 1) = CLsA.Colonnes(N).Name
TLBx(LLBx, 2) = StrNum(QtéStock, 7)
TLBx(LLBx, 3) = StrNum(QtéRequisePour1000000, 7)
TLBx(LLBx, 4) = StrNum(QtéRequisePourFab, 7)
TLBx(LLBx, 5) = IIf(QtéRequisePourFab > QtéStock, "INSUFFISANT !", "Disponible.")
End If: Next N
ListBox1.List = TLBx
End Sub