Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deletion Flag

Status
Not open for further replies.

frenchy62

MIS
Feb 24, 2003
7
US
On a previous post dated 4-8-4, lupins46 (MIS) response was:

The first thing to stress here is that if you allow users access to data through table datasheets then there is nothing you can do to track what is going on.
Control of user actions is only possible if the data is viewed/modified through forms.

The simplest approach is not to delete anything. Just put a deletion flag (Yes/No field) on each table (along with a deletion date/time field and username field, if you wish) and then modify your queries and object sources to ignore the deleted items.

You would need to trap the delete event for each form and cancel it, setting the flag through code in the process.

My next choice would be a separate archive database file. You would still use the trapping code but you would first append the record to a corresponding table in the archive database; the deletion could proceed as normal then.

Could you please explain,on how I can do this. What is the first step to the deletion process. What is the code and where would I put it. How do I trap the delete event in my form. Also, how do I do a separate archive and so forth. I would appreciate your help. This is exactly what we were looking for in our database.
 
First, add a delete (or inactive) flag to the base table where the user is doing the delete. Then, change the logic behind the delete activity in the form to update the record and set the delete flag to the deleted state rather than deleting the record. Now, you are no longer deleting records, but marking them as inactive or deleted in a logical rather than physical manner.

However, you now need to exclude the deleted records from all reports which report on active records, so you need to modify each report or query to have an additional condition of delete_flag (or whatever you decide to call it) = 'N'.

Hope this helps. If not, we'll keep trying until you get the results you need.

Sometimes the grass is greener on the other side because there is more manure there - original.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top