Autonumber - starting number

  • Thread starter Matt, Sheffield, UK
  • Start date
M

Matt, Sheffield, UK

How can you change which number your autonumber starts at, its also my
primary key but i want to start a number range from 7000000 then have the
database count up ?
 
R

Rick Brandt

How can you change which number your autonumber starts at, its also my
primary key but i want to start a number range from 7000000 then have
the database count up ?

It is generally not a good idea to use an AutoNumber when you care at all
about the value (other than it being unique). However; you could insert a
record with an append query that has a value for that field of 6999999, then
delete it afterwards. All AutoNumber values would then proceed from the
next number providing that you don't compact the file before entering your
first record.
 
J

Jeff Boyce

Matt

In addition to Rick's comments, keep in mind that Access Autonumbers are NOT
guaranteed to be sequential. In fact, you can almost count on ending up
with apparently "missing" autonumbers in a sequence. If you are intending
to use the Autonumber value as an auditable ID, you'll probably end up
having to explain to the auditors why there are missing records...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
N

Nouba via AccessMonster.com

I do not doubt Rick's and Jeff's statements. I nevertheless do not want a
short solution of the problem withheld.

ALTER TABLE [Tablename] ALTER COLUMN [Autofieldname] COUNTER(NewStartnumber,
NewOffset)
 
J

Jeff Boyce

Norbert

I don't believe my motivation was to withhold. I was trying (perhaps
indirectly) to elicit a wider description of the perceived need. There are
undoubtedly situations in which what the original poster asked is
appropriate, but I didn't understand the situation well enough yet to offer
a final recommendation.

Knowing HOW to is not as valuable as knowing WHEN to, in my mind.

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