Results 1 to 5 of 5
  1. #1
    Baz16 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2015
    Posts
    11

    The changes you requested to the table were not successful because they would create duplicate value

    I have 2 tables, 1 a list of analysts names and logins, the other of work in.

    The relationship betweenthe 2 tables are Analyst Name and Assigned to.

    I have then tried to create a form with subform so that if you select an Analyst from a drop down box on the main form the the sub form populates all the work that has been assigned to the selected Analyst from the combobox. I have created this form and it does populate correctly depending on the analyst name I select from the drop down box, however I have keep getting the below message everytime I click on the subform or try and close the form

    "The changes you requested to the table were not successful because they would create duplicate values in the index, primary key or relationship. Change the data field in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again".

    I am not trying to edit any data, just simply be able to click on it or close it without any error messages,

    How do I do this,



    Thanks

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,526
    In the table that is getting duplicated, in design mode, click the field, in the properties there is INDEXED (prob set to NO DUPLICATES)
    Either remove the index
    or DUPLICATES OK

  3. #3
    Baz16 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2015
    Posts
    11
    Hi, thanks for the reply, the table with the duplicates would be the Work in, and the field is the Work In Ref, which is a the primary field. Would this mean I would have to remove the Primary key. I don't want it to be able to create duplicates but i am not wanting to make any changes at this stage, its just to view the list of work each analyst has.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,742
    An Access form/subform set up is usually done when you have tables in a 1 to many relationship.
    In your case it appears that 1 employee can be assigned to many WorkItems/Projects (or whatever the second table is called).

    Employee---> WorksOnProject

    Consider Employee 01 John Doe who works on 3 Projects (900, 912, 975)
    Code:
    01 John Doe -----> 01 900 
                       -----> 01 912
                       -----> 01 975
    The 1 side of the relationship is presented on the Form, and the many side is on the subform.
    The form/subform has link fields between tables (pk of Employee and FK EmployeeID of WorksOnProject)

  5. #5
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,526
    Keep the original w keys, rename it , make a new one w/o keys but index w dupes using the correct table name
    copy the original data into the new one, test it out.

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

Similar Threads

  1. Replies: 1
    Last Post: 06-18-2014, 04:08 AM
  2. Unable to create duplicate record on subform
    By nika.duncan in forum Programming
    Replies: 9
    Last Post: 12-02-2013, 02:26 PM
  3. Replies: 20
    Last Post: 09-12-2012, 06:52 PM
  4. Replies: 5
    Last Post: 05-02-2012, 07:56 AM
  5. Replies: 0
    Last Post: 03-16-2010, 08:10 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