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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
| Private Sub SpinButton_plomb_Change()
i = SpinButton_plomb.Value
'Empêche de trop remonter
If i < 2 Then
i = 2
SpinButton_plomb.Value = i
End If
'récup les infos
If i > 1 Then
RefProd = Feuil1.Cells(i, 1)
TextBox_Num_série_plomb = Feuil1.Cells(i, 2)
TextBox_Nom_prod_plomb = Feuil1.Cells(i, 3)
TextBox_Desc_plomb = Feuil1.Cells(i, 4)
TextBox_Cat_plomb = Feuil1.Cells(i, 5)
TextBox_Taille_plomb = Feuil1.Cells(i, 6)
TextBox_Qté_sto_plomb = Feuil1.Cells(i, 7)
TextBox_Seuil_plomb = Feuil1.Cells(i, 8)
TextBox_PUV_plomb = Feuil1.Cells(i, 9)
RefFrn = Feuil1.Cells(i, 10)
TextBox_PUA_plomb = Feuil1.Cells(i, 11)
TextBox_Délai_plomb = Feuil1.Cells(i, 12)
End If
'Vide si pas de produit
If RefProd = 0 Then
TextBox_Num_série_plomb = ""
TextBox_Nom_prod_plomb = ""
TextBox_Desc_plomb = ""
TextBox_Cat_plomb = ""
TextBox_Taille_plomb = ""
TextBox_Qté_sto_plomb = ""
TextBox_Seuil_plomb = ""
TextBox_PUV_plomb = ""
TextBox_Nom_Frn_plomb = ""
TextBox_Num_Frn_plomb = ""
RefFrn = 0
TextBox_PUA_plomb = ""
TextBox_Délai_plomb = ""
TextBox_Qté_sto_plomb.Font.Bold = False
TextBox_Qté_sto_plomb.BackColor = &H8000000F
Exit Sub
End If
'Affiche si stock égale zéro
If TextBox_Qté_sto_plomb = 1 Then
TextBox_Qté_sto_plomb.Font.Bold = True
TextBox_Qté_sto_plomb.BackColor = vbRed
Else
TextBox_Qté_sto_plomb.Font.Bold = False
TextBox_Qté_sto_plomb.BackColor = &H8000000F
End If
'Affiche le nom du fournisseur
j = 2
While Feuil9.Cells(j, 1) <> ""
If Feuil9.Cells(j, 1) = RefFrn Then
TextBox_Nom_Frn_plomb = Feuil9.Cells(j, 2)
End If
j = j + 1
Wend
button_valider_plomb.Visible = False
Button_Créer_plomb.Visible = True
End Sub |
Partager