Results 1 to 7 of 7
  1. #1
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199

    Autonumber Coming from middle


    I have a table where the details are imported from excel and there is a autonumber as pk i have kept, but when ever i reset the autonumber and import the file the number starts from 30 i need it from 1 hw can i do it?

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    The only way to have an autonumber to start from one after records have been entered is to delete all records, then do a compile and repair.

    Why do you need the autonumber field to start from 1?
    The autonumber field should NEVER be visible to the users.


    Autonumbers--What they are NOT and What They Are
    http://www.utteraccess.com/wiki/index.php/Autonumbers

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by ssanfu View Post

    ...The autonumber field should NEVER be visible to the users...
    And never be used for any purpose other than uniquely identifying a given Record! Period!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    You guys are harsh. Remind never to show you my AutoNumbers!

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Steve meant 'Compact and Repair'.

    If you want every import to start with 1 then the ID is not unique. Autonumber is supposed to generate a unique ID for each record.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199
    Thanks, guys...i am clear now.

  7. #7
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Yeah, what June said.. (my confuser doesn't know how to type)

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

Similar Threads

  1. Parsing Middle of String
    By OprEowyn in forum Queries
    Replies: 4
    Last Post: 02-20-2013, 10:53 PM
  2. Need to Remove Varying Middle Text
    By EZRider in forum Queries
    Replies: 4
    Last Post: 10-10-2012, 03:45 PM
  3. Replies: 3
    Last Post: 05-08-2011, 12:55 PM
  4. More than one middle name
    By vorstopzolder in forum Access
    Replies: 5
    Last Post: 02-10-2011, 01:09 AM
  5. how select middle characters on string ???
    By ayman.maher in forum Queries
    Replies: 1
    Last Post: 04-27-2010, 09:29 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