Results 1 to 6 of 6
  1. #1
    Torinjr is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    53

    No Duplicates - Across multiple fields only.

    Click image for larger version. 

Name:	Untitled2.png 
Views:	11 
Size:	15.2 KB 
ID:	20584


    I have a table, displayed above, that is updated using a form. As you can see the 2nd field has 3 duplicates for (100 mm white.) with field 4 being different for ID 86.

    I have purposefully allowed for duplicates by setting the Indexed as Yes (Duplicates OK) because the records are different in field 4. However, i want to disable duplicates when the Records are identical accross all fields, as shown by ID 84 and 85. Is this possible?

    Would it be easier to set up a query for the Form that check for these duplicates across all fields instead?


    Cheers

  2. #2
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    I think you can run a delete duplicates query and select the fields you want to be in it.
    So you would leave the ID number out of the query.

  3. #3
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    in your table design, click on indexes in the ribbon, give it a name (any name) then add your fields you want to be unique i.e. whatever your fields are called for 100mm white, Marshland... and road marking (not ID). Then click back on the index name and set Unique=yes

    Note you will need to remove any existing duplicates before you can set this up.
    Click image for larger version. 

Name:	Capture.JPG 
Views:	8 
Size:	60.0 KB 
ID:	20589

  4. #4
    Torinjr is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    53
    Thanks Ajax although this only helps me with duplicates in individual fields. I want to remove items that are duplicate across all fields. I think the query might be the best way to go.

  5. #5
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    Thanks Ajax although this only helps me with duplicates in individual fields
    Clearly you have not tried my suggestion - the example in my post will prevent duplicates across fields A,B and C -so in your example the row with ID=85 could not be entered.

  6. #6
    Torinjr is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    53
    Oh yes it worked. Sorry i mis-read your solution and over looked it. Thank you this has helped lots.

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

Similar Threads

  1. Ensuring no duplicates between 2 fields
    By johnvog in forum Database Design
    Replies: 1
    Last Post: 12-13-2014, 06:21 PM
  2. Replies: 2
    Last Post: 10-03-2014, 11:57 PM
  3. Replies: 1
    Last Post: 12-23-2013, 03:19 PM
  4. Finding duplicates in two fields
    By skipnick in forum Access
    Replies: 6
    Last Post: 12-10-2013, 01:29 PM
  5. Allow ONLY duplicates in two fields
    By KWasley in forum Access
    Replies: 1
    Last Post: 04-17-2013, 09:04 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