Results 1 to 4 of 4
  1. #1
    JimO is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    126

    Issue with a Composit Key

    I have a table with names (actors, directors, producers etc.) with [Prefix], [FirstName], [MiddleName], [LastName], [Suffix]. I am trying to prevent duplicate entries so I want to set up a composite key based on all of the fields but I am unable to get more than 2 fields to work.

    As an example there could be:

    Alan Hale
    Alan Hale Sr.


    Alan hale Jr.
    Sir Alan Hale
    Alan G. Hale

    so some fields will be blank. As I said I can get the first and last names to prevent duplicates but when I try to include other fields it stops working and allows duplicate entries.

    Jim O

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Do you consider your example names to be duplicates? Access won't.
    What exactly do you want to prevent?
    You may have to review records where first and last name match anther record, then go to address etc to determine if duplicates.
    This info may help with unique composite index

  3. #3
    JimO is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    126
    As I have it set up now, Alan Hale Jr. has to be entered as [FirstName] Alan [LastName] Hale Jr. and the same for Hale Sr. I would like to enter each as Alan Hale and then in the Suffix field 'Jr.' or 'Sr.' respectively. I have to make each last name unique.

    Jim O

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    And what if you have 2 or 3 Jim Smith, or Tom Brown?

    You can get duplicate names eg FirstName LastName
    Not everyone will have or use a suffix, so it will be NULL quite often.
    The Sir will be very rare.

    I've dealt with names and addresses and think you might want to have some logic/code to review other attributes when you
    get a duplicate on first and last name. You may the want to see state, zip, full address, phone number, email..... to ensure this is a duplicate, then put in to a rejected file with date and reason.

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

Similar Threads

  1. Replies: 5
    Last Post: 01-08-2015, 02:08 PM
  2. CDate and CStr issue with "Invalid Use of Null" Issue
    By excellenthelp in forum Queries
    Replies: 3
    Last Post: 07-25-2014, 01:34 PM
  3. Replies: 22
    Last Post: 05-21-2013, 07:54 PM
  4. Replies: 2
    Last Post: 05-29-2012, 12:33 PM
  5. VBA issue
    By manic in forum Programming
    Replies: 4
    Last Post: 02-28-2012, 03:57 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