Non, le non est bon = Image4.
voila en gras et rouge la partie du code qui ne fonctionne pas avec Image4_clic() alors qu'il fonctionne si j'utilise un bouton
(Mes données ne sont pas mise à jour, et le message "Opération effectuée avec succes !" s'affiche dans le Msgbox
Private Sub Image4_Click()
Dim cellule As Range
Dim X As Integer
Dim w As Integer
w = 1
StrRep = MsgBox("Voulez-vous enregistrer les modifications ?", vbYesNo + vbQuestion + vbDefaultButton2, "Confirmer")
If StrRep = 6 Then
For Each cellule In Range("BDDoutil!A:A")
If cellule = "" Then Exit For
If cellule = Range("IdProduit") Then
X = cellule.Offset(0, 6).Value
If cellule.Offset(0, 14) < 0 And TextBox6.Value < 0 Or TextBox6.Value > X Then
MsgBox "Ce produit est en rupture, il doit être réaprovisionné pour être modifier", vbCritical, "Erreur"
TextBox6.Value = cellule.Offset(0, 6).Value
Else
For i = 1 To 14
cellule.Offset(0, w) = Range("ProduitInfos").Offset(0, w)
w = w + 1
Next
MsgBox cellule.Offset(0, 6)
If Range("ProduitInfos").Offset(0, 14).Value = "N" Then
cellule.Offset(0, 14) = "N"
Else
cellule.Offset(0, 14) = Range("ProduitInfos").Offset(0, 6) - Range("ProduitInfos").Offset(0, 7)
End If
cellule.Offset(0, 15) = Range("ProduitInfos").Offset(0, 15)
cellule.Offset(0, 19) = Range("ProduitInfos").Offset(0, 19)
If cellule.Offset(0, 14) < 1 And Label16.Visible = False Then
MsgBox "Attention, ce produit est maintenant en rupture !", vbExclamation, "Rupture"
Else
MsgBox "Opération effectuée avec succes !", vbInformation, "Succes"
End If
lesinfosproduits
MAJinfos
Unload Me
OutillageStock.Show
End If
End If
Next
Else
Unload Me
InfosProduit2.Show
End If
End Sub