Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Apr 2001
    Location
    Guatemala City
    Posts
    515
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reset autonumber field (Win ME/Office 97)

    I have seen this on the forum, but my searches don't find it. Sorry.

    How do I reset an autonumber field to zero?

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Reset autonumber field (Win ME/Office 97)

    To begin with, you need to delete all the records in the table, and then compact the database. That will set the autonumber so the first record created is 1. If you do the compact with records still in your table, the next record will be added with a value 1 greater than the highest number in the table. This all assumes of course that your autonumber field is not set to random.
    Wendell

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Reset autonumber field (Win ME/Office 97)

    Wendell has explained how to reset the AutoNumber field.

    But it really shouldn't matter whether an AutoNumber field starts at 1, or whether all values are contiguous. An AutoNumber field is typically used to provide a unique identifier for a record; its value is meaningless in itself and in most cases should be invisible to the end user. If you need a meaningful identifier, it's better to use a second field (apart from the AutoNumber field) for this, and set its value in code.

Posting Permissions

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