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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Log deleted records

Status
Not open for further replies.

pdtit

Technical User
Nov 4, 2001
206
BE
Hello,

I was wondering if somebody has some piece of code how to create some kind of logging of deleted records through a form.

My database is used for 3 different shops; in the main shop, when products are changed, updated or added, they get a "modifdate" flag which is used to create a dummy table to update the other shops.

However, when I delete a record in the main shop, this data is gone and no records will be deleted from the other shops.

How could I solve this ?

Regards,

Peter
 
Hi

Two suggestions

1. Do not in fact deleted the records, just flag them by having a checkbox column for deleted (eg say chkDeleted), use queries to restrict the recordset returned to only current records.

2. In the OnDelete event of the form, write deleted records to another "log" table using SQL somthing like:

strSQL = "INSERT INTO LogTable SELECT * FROM MyTable Where Id = " & MyId & ";"
docmd.runsql strsql


Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top