Results 1 to 4 of 4
  1. #1
    TJ1010F is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    May 2015
    Posts
    5

    Highlight Duplicate Values in Query Results

    I have a query that will return something similar to the table below:

    ID Visit Number Measurement
    1 1 5
    1 2 6
    2 1 7
    3 1 8
    3 2 9
    3 3 10

    I want it to look like: where red is highlighed



    ID Visit Number Measurement
    1 1 5
    1 2 6
    2 1 7
    3 1 8
    3 2 9
    3 3 10


    I want to highlight all the rows that have duplicate values in ID (meaning they have multiple visits basically). So far all my searches have only turned up ways to Query for duplicate values, which is not necessarily what I want, I want to see the duplicate values within the Query I have already set. Is there some way to integrate this in to the Query or do I need code for like a Macro or something to run on the results of the Query? What would that code be!



    Thanks a lot for all your help!

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Perhaps you can use the count function in your query and count the ID column. Then, you can use conditional formatting or VBA in a form to change the Fore Color.

  3. #3
    TJ1010F is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    May 2015
    Posts
    5
    Forgive my lack of knowledge, I need the results in their query form as I need to be able to make changes on what turns up (so not in a form) I am having trouble working out the conditional formatting for duplicates in that setting. Ah any pointers?

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I do not think you get an option for formatting a Query Object, other than the global settings via options. So, I am thinking you are stuck with a form. Besides, that is what forms are for; displaying data in a format the User can appreciate.

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

Similar Threads

  1. Replies: 3
    Last Post: 01-16-2013, 11:56 PM
  2. Replies: 6
    Last Post: 06-20-2012, 06:42 AM
  3. how to highlight search keywords in results form?
    By Absolute_Beginner in forum Forms
    Replies: 2
    Last Post: 08-22-2011, 04:52 AM
  4. Query Brings back duplicate results
    By DaveyJ in forum Queries
    Replies: 1
    Last Post: 06-10-2010, 05:59 PM
  5. Replies: 0
    Last Post: 10-16-2008, 02:39 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