Results 1 to 7 of 7

Thread: Can you reset an Autonumber field in Access ?

  1. #1

    Thread Starter
    Frenzied Member TheBionicOrange's Avatar
    Join Date
    Apr 2001
    Location
    Cardiff, UK
    Posts
    1,818

    Can you reset an Autonumber field in Access ?

    I've got a table with a field defined as AutoNumber.

    This field is the primary key for the table.

    I have cleared out all the records, and want to reset the number to 1 before importing new records, but can't work out how to reset it. Can this actually be done, or do I have to define a new table ?

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Delete all records( you did this) and compact the access db 3 times (dbwindow - menu - tools>Database>Compact or something).


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    Frenzied Member TheBionicOrange's Avatar
    Join Date
    Apr 2001
    Location
    Cardiff, UK
    Posts
    1,818
    Excellent ! Cheers Vince

    Spent the last 10 minutes searching the site for similar problem, but couldn't find an answer that simple.

    People were being told to recreate tables and move data over

    Not quite sure why you suggested doing it 3 times though, I found once was enough

    Thanks again.

  4. #4
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    When you compact an access mdb - it flags those things to change on the first pass (changing counters and stuff.

    On the second pass it removes those flagged things (including wasting space of records and reflags some more

    On the third pass you've compacted as much as possible

    But for your purpose - yup once'll be enough


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  5. #5

    Thread Starter
    Frenzied Member TheBionicOrange's Avatar
    Join Date
    Apr 2001
    Location
    Cardiff, UK
    Posts
    1,818
    Well you learn something new every day

    Thanks for the info Vince ..... most helpful

  6. #6

    Thread Starter
    Frenzied Member TheBionicOrange's Avatar
    Join Date
    Apr 2001
    Location
    Cardiff, UK
    Posts
    1,818
    Thank you Michelle

  7. #7
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    Excellent bits of info.
    Glad I read this thread.


Posting Permissions

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



Click Here to Expand Forum to Full Width