how do I undo changes made to a form

dammy

Registered User.
Local time
Tomorrow, 00:00
Joined
Sep 13, 2010
Messages
29
Good day everyone
It has really been awhile I posted in this forum
Please I have a form purchase order details, that I used to enter quantity of items purchased.
I found out that I can't delete quantities entered on the form.
It appears to delete, but on checking the quantity in the inventory, it was not deleted.
The vba code in my quantity section of the page is this
Quantity_AfterUpdate()
Dim IT As InventoryTransaction
If Me![Quantity] = 0 Then
RemoveCurrentLineItem
End If
AddPurchase Me![Purchase Order ID], Me![Item ID], Me![Quantity], NewInventoryID
End Sub
Thanks
 
Welcome aboard:)
Once a record has been saved, you need to delete it. The esc key only works to back out an update until a record is changed. You also need to keep in mind that when using a main form/ sub form, the main form record is saved when you move the focus to the subform so you would need to delete the main form record. If you have set up cascade delete on this relationship (you should for order-->orderDetails tables) deleting the parent record will delete the child records also. If you haven't defined cascade delete, you will need to delete the child records first, then delete the parent record.

If you have code that updates a table that is not bound to the form, you will need to write code that reverses that action and runs it.

I can't tell from your description how your app is defined so I hope I covered all the bases.
 

Users who are viewing this thread

Back
Top Bottom