Results 1 to 4 of 4
  1. #1
    bullwinkle55423 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2006
    Posts
    16

    Resetting autonumber when importing

    I have a table set up that I import an Excel file to. This table has an autonumber field to keep the sequence of the rows set. Before I do an import, I delete all of the records form the import table. However, the autonumber field starts with the last number used and it is getting to be a pretty large number.



    Is there a way, either in the table properties or via VBA code, to reste the autonumber to 1 or some other number.

    Thank you for your help.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You should find this link helpful.

  3. #3
    bullwinkle55423 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2006
    Posts
    16

    I'm not sure this worked..

    I tried the code that you provided, but it didn't seem to reset the autonumber. And as I looked at the code, it appears to only work if I want to set the counter higher. (If the highest number is 500, I can make the next one 1000). But it doesn't let me reset it back to 100 or 1.

    Am I missing something?

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    With all of the records deleted, if you Compact and Repair the AutoNumber seed is set back to 1.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Customizing the Autonumber field
    By wasim_sono in forum Access
    Replies: 3
    Last Post: 10-24-2014, 03:00 PM
  2. duplicate autonumber
    By rayc in forum Access
    Replies: 5
    Last Post: 06-19-2013, 07:50 AM
  3. Problems with autonumber field in a form
    By admaldo in forum Forms
    Replies: 0
    Last Post: 02-25-2008, 11:09 AM
  4. AUTONUMBER
    By J A F F A in forum Database Design
    Replies: 1
    Last Post: 10-03-2007, 10:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums