تفضل أخي أنا جربت عندي
Private Sub btn_supprimer_Click()
Dim rs As Recordset, Quantite As Long
Set rs = CurrentDb.OpenRecordset("SELECT * FROM Sorties WHERE id=" & Me.txt_id & " ")
If Not rs.EOF Then
Quantite = rs("Quantite")
rs.Close
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE FROM Sorties WHERE id=" & Form_Sorties.txt_id
DoCmd.RunSQL "UPDATE Stock SET Sortie=Sortie-" & Quantite & " WHERE id=" & Me.txt_id & " "
DoCmd.SetWarnings True
Form_Sorties.Requery
Else
MsgBox "L'enregistrement que vous essayez de supprimer n'existe pas !", vbCritical, "Erreur"
End If
Set rs = Nothing
End Sub