Start at

I

IfeelSilly

I am doing an inventory Database and I need my product id number to start at
1 but it has started off at 8. I messed up on it due to wrong info so I
started over and it picked up where I left off.
 
D

Douglas J. Steele

Why do you need the product id number to start at 1? You should never attach
any significance to the value of an Autonumber field. If its value matters
to you, you probably shouldn't be using an Autonumber field.

The only purpose of an Autonumber field is to provide a (practically
guaranteed) unique value that can be used as a Primary Key. 8, 10, 11, 12
serves that purpose just as well as 1, 2, 3, 4 does.
 
D

Dorian

Empty your table then do a compact and repair. It should reset the seed.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
K

KenSheridan via AccessMonster.com

As Doug has pointed out, if the values are significant an autonumber is not a
suitable solution. If you really do need to maintain sequential values the
only reliable way is to compute the values when a record is inserted via a
form. Roger Carlson has an example which also prevents conflicts in a multi-
user environment at:

http://www.rogersaccesslibrary.com/...?TID=395&SID=83z7c11zc7b721d2a1e51989c53d7ffb


and there's a slightly more complex one of mine, which additionally allows
the next number to be used to be 'seeded' at:

http://community.netscape.com/n/pfx...yMessages&tsn=1&tid=23839&webtag=ws-msdevapps


Ken Sheridan
Stafford, England
 
S

Steve

If all you have is a TblProducts and you have not entered any data yet that
uses ProductID as a foreign key, then open TblProduct in design view. Delete
the field ProductID. Then reenter the field ProductID. ProductID will start
at 1 and be sequential for all the products in TblProduct.

Steve
(e-mail address removed)
 

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