R
Rolf Rosenquist
Still working with my datalist - subform. When the user wants to delete a
row, I can ask him if that is OK in the Form_Delete event. If so, I put the
number of parts back into the stock table and the row is deleted. No
problems with that.
But when Access runs the following code in Form_After_DelConfirm:
If Status = acDeleteOK Then
LagerAntal = DLookup("Antal", "Produkter", "[ProdID] = " &
ProduktNr)
LagerAntal = LagerAntal + AntalIorder
sqlText = "UPDATE produkter SET [antal]=" & [LagerAntal] & " WHERE
[ProdID] = " & ProduktNr & ";"
DoCmd.RunSQL sqlText
End If
.... there comes another message that says, if I translate to english,
something like *You are updating 1 row(s)* and there is OK and Cancel
buttons. If the user answers OK everything works fine. But if he hits the
Cancel, there will be an error message that says that the RunSQL was
interrupted and points to the last row above. No matter if I run this code
in After_DelConfirm or Before_DelConfirm.
Is there a way to suppress this message? That would solve my problem, I
think.
If so, I would also be able to suppress the sam message when the user adds a
new row in the datalist. I think they are annoying and demanding too much
inputs from the user.
/ Rolf
row, I can ask him if that is OK in the Form_Delete event. If so, I put the
number of parts back into the stock table and the row is deleted. No
problems with that.
But when Access runs the following code in Form_After_DelConfirm:
If Status = acDeleteOK Then
LagerAntal = DLookup("Antal", "Produkter", "[ProdID] = " &
ProduktNr)
LagerAntal = LagerAntal + AntalIorder
sqlText = "UPDATE produkter SET [antal]=" & [LagerAntal] & " WHERE
[ProdID] = " & ProduktNr & ";"
DoCmd.RunSQL sqlText
End If
.... there comes another message that says, if I translate to english,
something like *You are updating 1 row(s)* and there is OK and Cancel
buttons. If the user answers OK everything works fine. But if he hits the
Cancel, there will be an error message that says that the RunSQL was
interrupted and points to the last row above. No matter if I run this code
in After_DelConfirm or Before_DelConfirm.
Is there a way to suppress this message? That would solve my problem, I
think.
If so, I would also be able to suppress the sam message when the user adds a
new row in the datalist. I think they are annoying and demanding too much
inputs from the user.
/ Rolf