General information
Category:
Coding, syntax & commands
I use a grid for the detail of an order entry form, I added methods to the grid rather than the form because the same grid is used on several forms. One method, I call DeleteOne, deletes the current record of the recordsource of the grid. I begin a transaction,make updates to three other tables effected by the delete, and if all is successfull, delete the record, if not ROLLBACK.
Now I want to add a method that deletes all records in the grid which is detail for a single order. Call it DeleteAll and I want to begin a transaction, start at first record and call DeleteOne ( remeber this method uses BEGIN TRANS and END TRANS in itself ) and move through the detail records calling DeleteOne on each record. If for some reason one record can not be deleted and I issue ROLLBACK in DeleteAll method, will the tables updated when END TRANS was issued on each record in DeleteOne be rolled back also ?
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only