Autonumber field changes to random from sequential

A

Anthony Fontana

I design a table with the key field set to autonumber - sequential. I then
append records to it from another table imported from an Excel Spreadsheet.

Why does the key field in the table being appended to change to autonumber -
random every so often and how can I stop that.

Thanks in advance.
Anthony.
 
J

Jeff Boyce

Anthony

I may be reading too much into your description ...

It sounds like you require the Autonumber field to be sequential.

Are you aware that there's no guarantee that Autonumber will be sequential?
The Access Autonumber field is intended to provide a unique row identifier,
and is generally unfit for human consumption.

Are you trying to display that number?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
A

Anthony Fontana

No. I just don't like the fact that (a) Access changes it to random when I
set it to sequential and (b) negative numbers are sometimes generated. We
use the autonumber field for ID numbers which get printed on certain IDs and
I think that assigning a negative ID number to person doesn't look right.

Personally, I don't care if the numbers are random, I just don't like the
negative numbers that the random setting seems to generate.

Thanks
 
J

Jeff Boyce

Anthony

So you are trying to use automatically-generated (Autonumber) row
identifiers as human-readable data (i.e., IDs). You've (re-)discovered one
of the many reasons Autonumbers are not generally fit for human consumption.

If you need a human-friendly ID number, add another field to your table and
generate those numbers to be sequential (search for "Custom Autonumber"
on-line or at mvps.org/access). Use that field instead of the Access
Autonumber field.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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