autonumber...reorder??

  • Thread starter Thread starter mm
  • Start date Start date
M

mm

I deleted a couple of records from my table, is there anyway I can re-order
the ID number that is assigned, so it goes consecutively, rather than skip
around ex, 7, 10, 11......
 
I deleted a couple of records from my table, is there anyway I can re-order
the ID number that is assigned, so it goes consecutively, rather than skip
around ex, 7, 10, 11......

No, nor should you need or want to.
The autonumber has just one purpose... to be a unique value. It need
not be consecutive. As you have already found, anytime you delete a
record, that number will no longer be available.
 
What FredG has said is correct, however if you are just starting and you need
to get it back in order and the files you deleted have no bearing on the
auronumbers - at this time - you can open to table you have the data in,
right click on it and copy. Then right click again and choose paste and it
will ask you for three choices one will be "Structure Only". You save it by
adding a _2 to your copied table name. Now run a query of the org table minus
the autonumbers and append it to the new table. Now check the new table for a
check of the info and your numbers should be in order, remember as FredG
stated once you delate data you should not reinstate the data with new
numbers. After viewing the data and it is correct change the name of the org.
table by adding _3 to it. Rename the new table by removing the _2 your links
etc. along with any forms or reports that you created do not have to be
reworked. Then save your table that has _3 after it in case you have to refer
back to it. In normal business applications, once you created the database
and saved the tables do not do the above. If it is for home use and you want
to reset everything OK.
 
mm said:
I deleted a couple of records from my table, is
there anyway I can re-order the ID number that
is assigned, so it goes consecutively, rather than
skip around ex, 7, 10, 11......

If you mean Access' Autonumber, that is intended for internal use, relating
Records between tables, and you might well destroy your existing
relationships. Also, should you do what you ask about, chances are you can
renumber, but it will disable the Autonumbering so future Records will not
be generated with unique numbers in that Field... something of a "you modify
it, you own it" situation.

If it is a number you generated yourself, and you know you will not be
causing yourself trouble, you can write code to do most anything you want
with 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

Back
Top