Access 2000, autonumber fields

Z

Zyberg74

How do I set up a field with an autonumber that starts with a number other
than 1?
 
J

Jamie Collins

Allen Browne said:
If you use an Append query to add the value 1 less than you want, Access
will then start from the number you desire.

I assume we are talking about an incrementing integer. Access2000
format is Jet 4.0, therefore the seed and increment may be specified.
For an autonumber that starts at 21 and increments in steps of 7 (21,
28, 35, ...) use:

CREATE TABLE MyTest(
MyID IDENTITY(21,7),
MyDataCol INTEGER NOT NULL
);

This is one of the newer Jet features so one must use the OLE DB
provider (although I heard a rumour that Access2003 can be put into
Jet 4.0 'mode' and use the newer syntax natively).

Jamie.

--
 
Top