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 42 43 44 45 46 47 48 49
| Private Sub Button_Valider_Click() 'plomberie
If TextBox_Num_série <> "" Then
'Enregistre les info
RefAchat = Feuil9.Cells(m - 1, 1) + 1
Feuil9.Cells(m, 1) = RefAchat
Feuil9.Cells(m, 2) = New_Date
Feuil9.Cells(m, 3) = RefProd
Feuil9.Cells(m, 4) = RefBon
Feuil9.Cells(m, 5) = RefFrn
Feuil9.Cells(m, 6) = PUA
Feuil9.Cells(m, 7) = Qté_Cdée
Feuil9.Cells(m, 8) = Qté_rec
Feuil9.Cells(m, 9) = Prix_Tot
'MAJ la qté en stock
i = 2
While Feuil5.Cells(i, 1) <> ""
If Feuil5.Cells(i, 1) = RefProd Then
Feuil5.Cells(i, 7) = Feuil5.Cells(i, 7) + Qté_rec
TextBox_Qté_sto = Feuil5.Cells(i, 7)
End If
i = i + 1
Wend
'Affiche si cde soldée'plomberie
If TextBox_Qté_rest = 0 Then
TextBox_Solde.Value = "Oui"
TextBox_Solde.Font.Bold = True
TextBox_Solde.BackColor = vbRed
Else
TextBox_Solde.Value = "Non"
TextBox_Solde.Font.Bold = False
TextBox_Solde.BackColor = &H8000000F
End If
'Affiche si stock égale zéro'plomberie
If TextBox_Qté_sto = 0 Then
TextBox_Qté_sto.Font.Bold = True
TextBox_Qté_sto.BackColor = vbRed
Else
TextBox_Qté_sto.Font.Bold = False
TextBox_Qté_sto.BackColor = &H8000000F
End If
End If
Button_Valider.Visible = False
Button_Créer.Visible = True
End Sub |
Partager