Archiving records

M

Maz Ten

I am currently archiving records to another table by creating an Append
query then a Delete query.
The Append query appends the required data to the archive table.
The Delete query then deletes the archived records from the original table.
This all works fine but I have to do that procedure 6 times
first for the main table data then for all the related tables.

Is there an easier way to archive records wether they are related tables or
not.

Thanks in advance

Maz T
 
V

Van T. Dinh

You can write a Macro using a number or OpenQuery (or
RunSQL) macro actions to execute your Queries / SQL String
one after another.

OTOH, you really should take advantage of the Transactions
in VBA to pair the Append/Delete so that either both
actions are done or neither are done rather than just
Append without Delete.

Check Access VB Help (DAO) on "BeginTrans, CommitTrans,
Rollback Methods"

HTH
Van T. Dinh
MVP (Access)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top