Key

  • Thread starter Thread starter Pass-the-reality
  • Start date Start date
P

Pass-the-reality

In my table, I have my ID number (key) set to AutoNumber, Long Integer,
Increments with Indexed set to Yes (No Duplicates). What do I need to do set
my ID number to what ever I want. Example - instead of ID starting at 1, how
do I change it to start at 1100?
 
From what i see on other sites, the only way to do this is to work
around it with an append query:

"Create the first table that contains the counter type field that you
want to start on another number. Don't enter any records.Create a
second table, with a single long integer number type field that has
the same name as the counter field in the first table. Create a record
in the second table by entering a number one less than the number you
want to start the counter at in the first table. Create an append
query, to append the one record in the second table to the first
table, and run it Delete the second table, delete the record that you
appended to the first table, and start entering data."


So append a record with a counter of 1099, delete that record, and
then the next autonumber should start at 1100.
 
G-B is quite right about the use of an append query, but if sequence is
significant don't use an autonumber; its designed only to guarantee arbitrary
uniqueness. Instead compute the next number as a record is inserted. There
are various ways of doing this. You'll find one example at:


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


which also includes a means of resetting where the next number in sequence
will start, and handles the possibility of conflicts where two or more users
are inserting a new record simultaneously in a multi-user environment.

Ken Sheridan
Stafford, England
 

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