Copying records from one table to another

  • Thread starter Thread starter Aran
  • Start date Start date
A

Aran

I am very much a beginner and wondered if its possible to
copy a record from one table and
place that record in another table and deleting it from
the original table in the process in a click of a button,
is this possible?

Basically once I need to archive an item all you would
need is to have the record on screen and select
the "archive" button.

Thankyou in advance
 
I am very much a beginner and wondered if its possible to
copy a record from one table and
place that record in another table and deleting it from
the original table in the process in a click of a button,
is this possible?

Basically once I need to archive an item all you would
need is to have the record on screen and select
the "archive" button.

You can do this by running an Append query to copy the selected record
(or records), followed by a Delete query to delete it. These queries
can be called from a Macro or (better) from VBA code.

As a rule, though, unless you have millions of records in your table,
you'll get a simpler design and adequate performance by just putting a
Yes/No field [Archived] in your table. Base your forms and reports on
a query selecting Archived=False, and simply toggle this value to
conceal or reveal a record.
 
I agree. Don't know how others feel about it, but it's my practice not to
let users physically delete anything. If you do, some will say: "The
database lost all my work!"

Much better to flag a Y/N field, then periodically as part of maintenance,
remove the flagged records. How often depends on performance. Could be at
month-end or year-end.
 
Back
Top