re-inserting deleted autonumbers

  • Thread starter Thread starter Effie
  • Start date Start date
E

Effie

I have a 5-table database design, several of which have autonumbers for a
primary key. For one of these tables, I have deleted a bunch of records and
pasted them into a 6th table called "Deleted sites." I put them in a 6th
table because I knew there'd be some possibility that I'd make some mistakes
-- like one or two of them I later figured out that I shouldn't have deleted
them. When I put these records back in, is there an easy way to re-insert
them such that they'll have the same autonumber?
 
Effie

First, why? Why bother moving records from one table to another? This is
what you'd probably have to do if you were using a spreadsheet, but you are
using MS Access, a relational database.

Rather than moving records, how about just adding a DateDeleted field and
putting the date in there that you would have "moved" the record. Then you
can modify your queries, forms and reports so that they only look at records
with DateDeleted values either Null or some time in the future.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Effie said:
I have a 5-table database design, several of which have autonumbers for a
primary key. For one of these tables, I have deleted a bunch of records and
pasted them into a 6th table called "Deleted sites." I put them in a 6th
table because I knew there'd be some possibility that I'd make some mistakes
-- like one or two of them I later figured out that I shouldn't have deleted
them. When I put these records back in, is there an easy way to re-insert
them such that they'll have the same autonumber?

You'll have to use an append query including the autonumber field. I
very much doubt copy and paste will work but that's possible.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
Back
Top