Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2004
    Posts
    38

    Smile Unanswered: How to reuse the field with AutoNumber data type?

    Hi. I've a database with a field using AutoNumber as data type. Could anyone tell me how to reuse the number (start with 1) after I've deleted all records in the table?

    Big Thanks in Advance ^_^

  2. #2
    Join Date
    Feb 2004
    Location
    Canada
    Posts
    133
    After you've deleted the records you need to compact & repair. That should reset them.

  3. #3
    Join Date
    Jan 2005
    Location
    United Arab Emirates
    Posts
    23
    Do a Compact & Repair after deleting all the rteocrd from the table

    Tools > Database utilities > Compact and Repair
    hope this helps

  4. #4
    Join Date
    Jul 2004
    Posts
    38
    Quote Originally Posted by ZmrAbdulla
    Do a Compact & Repair after deleting all the rteocrd from the table

    Tools > Database utilities > Compact and Repair
    hope this helps
    Thanks so much !! ^_^

  5. #5
    Join Date
    Oct 2003
    Posts
    706
    My frank recommendation is simple but direct: Don't!

    When you use an Autonumber type, you should be doing it in situations where the number that is produced is nothing more and nothing less than 'a cookie.'
    • The value is of no importance to anyone.
    • The value is never revealed to anyone (especially not to a human!).
    • The only thing that matters is that the value is always unique, and therefore, never re-used.

    While it may offend your sense of sensibilities that the starting record-number in your empty database is 305,224... don't let it.
    ChimneySweep(R): fast, automatic
    table repair at a click of the
    mouse! http://www.sundialservices.com

  6. #6
    Join Date
    Jan 2005
    Location
    United Arab Emirates
    Posts
    23
    AutoNumbers is a never ending topic of debate in most of the forums. I personally don't use Autonumbers as PK in any of my dbs unless the PK is not necessary for any other purpose or the table is not related to other.
    Better to use a discriptive abbriviation of the main field as they have done in NorthwindDB

  7. #7
    Join Date
    Sep 2004
    Location
    Tampa, FL
    Posts
    520
    Please bote trhat compact/repair does not rest autonumber count in newer versions of Access, Per MS.
    Darasen

  8. #8
    Join Date
    Jan 2005
    Location
    United Arab Emirates
    Posts
    23
    Darasen,

    Can you please show me the link of MS?

  9. #9
    Join Date
    Sep 2004
    Location
    Tampa, FL
    Posts
    520
    I am uncertain of the link ATM, I will look when I can. I poseted it just last week I believe. h I did miss where you stated that the DB was empty so i think it will reset to one. Older versions would reset the number while there was data in the table i am told.
    Darasen

Posting Permissions

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