Results 1 to 8 of 8
  1. #1
    grkatz823 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    8

    Using AutoNumber primary key on sorted column

    Hi,

    I've just begun using microsoft access and would like to create a primary key on a table of data that has been sorted alphabetically. However, when I try to create this key (designview -> auto number-> increment) it autonumbers for the column the way it was before i sorted it. Is there a known way of doing this?

    Thanks

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Why does it matter? Generation of PK should not be dependent on record sort. The autonumber will be assigned according to the order entered.
    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.

  3. #3
    grkatz823 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    8
    It's not necessary by any means. I'd like to create another table, where people write down the id and a change in quantity, and the changes will then be reflected in the original table. By having the id's in alphabetical order, it makes the manual lookup easier.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Why do users need to see this autonumber? Is there no other unique value in the table that could be referenced by users? The field used for alpha sort is not a unique value that could serve as PK?
    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.

  5. #5
    grkatz823 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    8
    The field used for the sort is the material name which are a lot of very similarly named chemicals that can be rather long. I didn't want to risk typos by people absent-mindedly entering the information.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Prevent typos with a combobox. Combobox has AutoExpand property as well as LimitToList.
    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.

  7. #7
    grkatz823 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    8
    Thanks, i didnt know that was possible.

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Issue resolved?
    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.

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

Similar Threads

  1. Sequential autonumber primary key
    By JackCampion in forum Access
    Replies: 0
    Last Post: 09-17-2012, 05:07 PM
  2. Replies: 1
    Last Post: 07-13-2012, 08:53 AM
  3. Replies: 4
    Last Post: 05-07-2012, 12:08 PM
  4. Replies: 1
    Last Post: 02-29-2012, 04:46 PM
  5. Replies: 2
    Last Post: 04-30-2010, 09:43 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