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
| Private Sub SpinButton1_Change()
i = SpinButton1.Value
'Empêche de trop remonter
If i < 2 Then
i = 2
SpinButton1.Value = i
End If
'récup les infos
If i > 1 Then
RefProd = Feuil1.Cells(i, 1)
TextBox_Num_série = Feuil1.Cells(i, 2)
TextBox_Nom_prod = Feuil1.Cells(i, 3)
TextBox_Desc = Feuil1.Cells(i, 4)
TextBox_Cat = Feuil1.Cells(i, 5)
TextBox_Qté_sto = Feuil1.Cells(i, 7)
TextBox_Seuil = Feuil1.Cells(i, 9)
TextBox_PUV = Feuil1.Cells(i, 11)
RefFrn = Feuil1.Cells(i, 12)
TextBox_PUA = Feuil1.Cells(i, 13)
TextBox_Délai = Feuil1.Cells(i, 14)
End If
'Vide si pas de produit
If RefProd = 0 Then
TextBox_Num_série = ""
TextBox_Nom_prod = ""
TextBox_Desc = ""
TextBox_Cat = ""
TextBox_Qté_sto = ""
TextBox_Seuil = ""
TextBox_PUV = ""
TextBox_Nom_Frn = ""
TextBox_Num_Frn = ""
RefFrn = 0
TextBox_PUA = ""
TextBox_Délai = ""
TextBox_Qté_sto.Font.Bold = False
TextBox_Qté_sto.BackColor = &H8000000F
Exit Sub
End If
'Affiche si stock égale zéro
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
'Affiche le nom du fournisseur
j = 2
While Feuil6.Cells(j, 1) <> ""
If Feuil6.Cells(j, 1) = RefFrn Then
TextBox_Nom_Frn = Feuil6.Cells(j, 2)
End If
j = j + 1
Wend
Button_Valider.Visible = False
Button_Créer.Visible = True
End Sub |
Partager