View Full Version : Save deleted records in another database


ABDULFATAH
10-31-2001, 07:12 AM
How to add a code to the delete button to automatically save the deleted record to another table in the same database or another database ?

manners
11-01-2001, 01:54 AM
You need to create a table to copy deleted (archived) files into that mirrors the target table where the data is stored.

Then an append query needs to be created using the table with the stored data in being copied to the newly created table.

You now need to attach this append query to a delete button on the form using the following VBA Code:

DoCmd.OpenQuery "Nameofappendquery", , acReadOnly

This should be inserted before the delete command lines.

bseche
01-25-2002, 11:10 AM
I tried what suggested but it append all the records and not current record. Is there away to append the curent record about to delete.

Jack Cowley
01-25-2002, 11:17 AM
You need to add criteria to the query so it knows which record to append.