Results 1 to 5 of 5
  1. #1
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727

    alphanumeric primary key

    Hi all,
    I am creating a data entry database for a client using Access 2003. They want there invoice number to be the primary key. It's alphanumeric. I have never created a primary key with a alpanumeric field. Can this be done effieciently? If so; how? What datatype to choose. This obviously has to be inputed not incremented correct?


    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,816
    This would be a text datatype field. The value would have to be manually input or generated with VBA code. Look at this thread https://www.accessforums.net/access/...ind-16967.html
    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
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727
    ok. so there are no ramifications for using an alphanumeric field as a primary key? I always used number data type for primary key.

  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,816
    Just that autonumber is not available. With any key that is not an autonumber, code and table settings need to be robust enough to ensure no duplication of generated value, regardless if all numeric or includes alpha.
    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
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727
    Great. The invoice number is always unique and the user would input during creating new records. Ill give it a shot. Thanks

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

Similar Threads

  1. Triple primary key
    By snoopy2003 in forum Database Design
    Replies: 1
    Last Post: 02-23-2011, 09:18 AM
  2. Primary Key Problems
    By skg in forum Database Design
    Replies: 5
    Last Post: 01-26-2011, 12:42 PM
  3. Format a field(AlphaNumeric)
    By Bakar in forum Database Design
    Replies: 1
    Last Post: 12-20-2010, 06:36 AM
  4. Primary Key Help
    By phoenix13 in forum Access
    Replies: 4
    Last Post: 07-30-2009, 12:36 PM
  5. about the primary key!
    By Yuesko in forum Access
    Replies: 1
    Last Post: 05-29-2009, 04:20 PM

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