View Full Version : Delete


goldstar19821982
03-19-2008, 07:30 AM
Hello All,

Currently i have a transaction list form which displays all the transactions which have been saved.
If the client no longer requires the order, there is a remove button which would delete this: see code below
This works fine,it deletes all the items within the listbox and client details but i want it to update the stock levels for all the items within the listbox when remiove is prssed.

Would anyone know how this can be achieved?

database.Execute ("Delete * from tbltransaction Where Hireno = " & Chr(34) & Forms!frmtransactionlist!txthireno) & Chr(34)

dbase.Execute ("Delete * from tbltransactionline Where hireno =" & Forms!frmtransactionlist!txthireno)

pbaldy
03-19-2008, 08:17 AM
This is one of the many reasons most of us recommend against storing the stock level (as did the link I gave you previously). If you've chosen to do so anyway, you'll probably need to open a recordset on those items and loop through it, removing each from it's respective stock level.