Results 1 to 4 of 4
  1. #1
    Join Date
    May 2003
    Location
    UK
    Posts
    233

    Unanswered: Auto Number starting number

    I have a autonumber field in a table.

    The number starts from 1 and increments by 1 on each entry.

    What I want to do is start the number from 1000 and then increment by 1

    Does'nt sound unreasonable to me, can someone tell me how it is done?

    Thanx

  2. #2
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    I know you can set the Identity Seed on a Sql Server table, but I don't
    think it's possible in access.

    One ugly workaround would be to create a sub to insert 999 "dummy records" into the table, and then delete them. After that, when you start inserting your real data, it would start with 1000.

    The only problem with that is:
    If you ever delete all the data in the table, and compact the DB, you're
    back to starting with 1.

  3. #3
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    confirmation: you can't set the starting point of an autonumber: it's either sequential from 1 or random.

    you can fake an autonumber (something along the lines of DMAX + 1)using a table of numbers but make sure you lock the table each time a user fetches a new number or you will risk duplicates.

    izy

  4. #4
    Join Date
    Jul 2003
    Posts
    16

    Re: Auto Number starting number

    Originally posted by HelpMePlease
    I have a autonumber field in a table.

    The number starts from 1 and increments by 1 on each entry.

    What I want to do is start the number from 1000 and then increment by 1

    Does'nt sound unreasonable to me, can someone tell me how it is done?

    Thanx
    If you run a search on Access Help it give you the solution, but here it is also. Create a Temporary table, call it Temp and give it one field called Number. Change the field type to Number and leave it Long Interger. Open the table and enter 999 and close. Create a new query for your table Temp. Change it to an Append Query setting the field Number as the Field and whatever your AutoNumber field name as Append To. Save and close. Run the query and it will append to your table you want to set. The next entry you make in that table will be 1000.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •