Results 1 to 5 of 5
  1. #1
    phoenix13 is offline Novice
    Windows XP Access 2003
    Join Date
    May 2009
    Posts
    5

    Primary Key Help

    I have a database that I'm setting up via Access. We want the primary key to be a last name+#.



    Is there any easier way then copying and pasting groups of last names and typing the numbers in manually?

    Thank you in advance.

  2. #2
    SoftwareMatters is offline Access VBA Developers
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    274
    I would set the primary key to be Surname & Initials rather than number. Would this be possible for you?

  3. #3
    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
    What is wrong with just using an AutoNumber as the PrimaryKey? People have been known to change their LastName.

  4. #4
    phoenix13 is offline Novice
    Windows XP Access 2003
    Join Date
    May 2009
    Posts
    5
    Quote Originally Posted by SoftwareMatters View Post
    I would set the primary key to be Surname & Initials rather than number. Would this be possible for you?
    Because we have enough names that we would have repeats that wouldn't work with Access. We'd like to be able to combine two columns that has a series of numbers and last names. I've been looking through a bunch of information on how to combine data from two columns. I have a feeling that I'm going to have to write a macro in VBA.

    I just don't know where to start with writing the code for one table. If any of you out there could help me out on that, that would be great... because I'm at a loss.

    Quote Originally Posted by RuralGuy View Post
    What is wrong with just using an AutoNumber as the PrimaryKey? People have been known to change their LastName.
    In this case, it's a moot point. This is for a cemetery's database. And we didn't want to use Auto Number because, if we're doing a quick search it's easier to use a combination of last names and numbers then just numbers.

  5. #5
    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 can search on any field you want. You can also index on any field you want. Neither has anything to do with a PrimaryKey.

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

Similar Threads

  1. Primary and Secondary Keys...
    By LittleOleMeDesigns in forum Database Design
    Replies: 5
    Last Post: 07-24-2009, 11:33 AM
  2. about the primary key!
    By Yuesko in forum Access
    Replies: 1
    Last Post: 05-29-2009, 04:20 PM
  3. Primary Key change macro?
    By gracin in forum Access
    Replies: 0
    Last Post: 03-06-2009, 10:59 AM
  4. reset primary key
    By emilylu3 in forum Access
    Replies: 1
    Last Post: 12-09-2005, 03:27 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