marcwolf
Posts: 361
|
| Posted: 08/15/2005, 6:55 PM |
|
This folks is just a suggestion of what we do when we need to put in a Soft Delete
We often just want to do a soft delete and have a batch of code for updateing Version Numbers, Dates, User ID etc in the BeforeUpdates.
However we have to somehow translate this into a Custom SQL for the delete. And it can be a real pain.
However - If you add this code into the BeforeExecuteDelete then you can save a lot of hassle.
Here is the Code
with applic_topic1
.deleted_fl.value = 1
.updaterow
.command.CommandOperation = 9
End With
How does it work.
If applic_topis is the form we set the soft deleted flag to 1
then we call the UpdateRow routine the will update the record with the correct data together with any updates to Dates, Userid etc
Then we send a '9' to the command object, which confuses it (nicely) and so it does not do the physical delte of the record.
So Soft delete easily within code, and no custom SQL etc ever needed.
Hope this helps someone
Dave
_________________
' Coding Coding Coding
Keep Those Keyboards Coding.
Raw Code!!!!!!!
|