Auto number

P

Paul

I have an autonumber field to generate a REF. I need to copy my table
because of problem but when I do this I loose my auto-number ref, how
can I get around this (some records have been deleted therefore can nt
just recreate it.
 
P

Paul

Paul,

A wee bit more information...

-Copy it where?  To another application?  Another table?
-Loose your AutoNumber REF how?
-What version of Access?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm






- Show quoted text -

Sorry, using Access 2003. My original table is corrupt so I am
importing clean records into a new database. Because by original auto
number field is not sequential anymore (because records have been
deleted over the months and we use this as a ref number in letters
etc) I just can not import to a new table as access wants to re-number
thus giving me a new number
 
G

Gina Whipp

Paul,

In addition to what Ken said...

If you care about your REF number then don't use AutoNumber. AutoNumber is
never guarenteed to be sequential not unique. If you are looking for
sequential I would suggest a different method. Use the AutoNumber key as a
PK and then creat your REF field as unique values (no duplicated) but not
as a PK. Use the function DMax("YourREFfield","YourTable")+1 to increment
your values. There are even queries you can use to re-use values should a
record get deleted.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

KenSheridan via AccessMonster.com said:
You can either (a) copy the table to the clipboard and then paste it
(structure and data) to a new table, or (b) copy and then paste it
(structure
only) to an empty new table, and then execute an 'append' query to insert
the
rows into the new table:

INSERT INTO [NewTable]
SELECT *
FROM [OldTable];

Either way the values in the autonumber column will be preserved.

Ken Sheridan
Stafford, England
I have an autonumber field to generate a REF. I need to copy my table
because of problem but when I do this I loose my auto-number ref, how
can I get around this (some records have been deleted therefore can nt
just recreate it.
 

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