Results 1 to 6 of 6
  1. #1
    Guy Winfield is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    May 2015
    Posts
    7

    Criteria Query Question !

    Hello everyone,



    I have a question. I'm looking to find out whether there is a type of criteria i can put in my query that allows which forbids one record to have the same values as the following record (i.e duplicate).

    Any help is appreciated !

  2. #2
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    use SELECT DISTINCT rather than SELECT if you are not summing, counting or averaging,etc. If you are then change your query to GROUP BY

  3. #3
    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,726
    I agree with Ajax, but I'm wondering if there is more to the question than you posted.

    If it is a duplicate value in only a few fields, then DISTINCT will do the job.

    A duplicate record in data base means all fields in 2 or more records have same values.
    You can establish primary key and/or unique composite index to prevent duplicates which is enforced at the database software level.

  4. #4
    Guy Winfield is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    May 2015
    Posts
    7
    I'm not very familiar with VBA much, is there anyway you could lay it out a bit simpler ? thanks !

  5. #5
    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,726
    Did you look at the links? There are step by step instructions re unique composite index.

    What VBA was giving you concern???

  6. #6
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    it is SQL, not vba. To changer a query to SELECT DISTINCT, in the query builder either

    1. go to the sql window and edit the code or

    2. in the query build widow, open properties and change unique values from no to yes

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

Similar Threads

  1. Criteria question
    By El Labrador in forum Access
    Replies: 2
    Last Post: 12-04-2013, 07:03 PM
  2. Query Criteria Question
    By RayMilhon in forum Queries
    Replies: 5
    Last Post: 06-28-2013, 10:49 AM
  3. query criteria question
    By damos2001 in forum Queries
    Replies: 3
    Last Post: 04-06-2013, 03:20 PM
  4. Question About Criteria
    By Kipster1203 in forum Queries
    Replies: 2
    Last Post: 05-20-2010, 12:09 PM
  5. Query Criteria Question
    By jrockusa in forum Queries
    Replies: 0
    Last Post: 11-13-2009, 09:16 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