Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Posts
    2

    Question Unanswered: Autonumber problem

    When a new record is added, the autonumber the record will be generated automatically in sequence. For example, the first 3 new record's autonumber will be 1, 2 and 3. However, after I delete the first three records, I add a new one. Its autonumber is 4. HOWEVER, it's actually now the first and only record in the table! How can I make its autonumber to be 1 and then the new records follows the sequence.

  2. #2
    Join Date
    Apr 2004
    Location
    Sydney Australia
    Posts
    369
    Quote Originally Posted by nickyowen99
    When a new record is added, the autonumber the record will be generated automatically in sequence. For example, the first 3 new record's autonumber will be 1, 2 and 3. However, after I delete the first three records, I add a new one. Its autonumber is 4. HOWEVER, it's actually now the first and only record in the table! How can I make its autonumber to be 1 and then the new records follows the sequence.
    Whenever you delete records you get what you are getting. If you like you can make a copy of your table and only its structure (right click on your table name) and then append your records to the new table but to not include the auto number field in the append.

    But if want number occuring in sequence then you are better to make your own numbers.

    It is also a bad idea to change the autonumber or for that matter any other number that has been used to link forms as the link will no longer work.

    Mike

  3. #3
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    to elaborate on what Mike is eluding to, it is critical to maintain integrity with your primary keys. If you alter the primary key all willy-nilly for whatever reason, you completely and total negate the benefits of using a relational database, and would be much better off using something like excel.

    Also, to reset the auto-number seed in an EMPTY database, simply delete and re-add the field.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  4. #4
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Quote Originally Posted by nickyowen99
    When a new record is added, the autonumber the record will be generated automatically in sequence. For example, the first 3 new record's autonumber will be 1, 2 and 3. However, after I delete the first three records, I add a new one. Its autonumber is 4. HOWEVER, it's actually now the first and only record in the table! How can I make its autonumber to be 1 and then the new records follows the sequence.

    nickyowen99, browse around in this forum, there is much about creating your own AutoNumber fields that you might find interesting.

    Bud
    Oh, click on this link below, it takes you to just what I was referring you to. Have a nice day.


    http://www.dbforums.com/t997992.html

Posting Permissions

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