Results 1 to 3 of 3
  1. #1
    perryc is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2019
    Posts
    122

    Conditional Format to compare records

    How do I do a conditional formatting to compare records results? Examples:
    Record1: Date1 & Event1


    Record2: Date2 & Event2

    IIF(Trim([Date1]&[Event1]) = Trim([Date2]&[Event2]), then, turn RED.

    I just don't know how to say that in the conditional format expression to say Date1, Date2, Date3... (basically any dates with and events combination.)

    Thank you for your help.

    Sincerely,
    Perry

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    Perry,
    Conditional formatting is done within the record not between them. To do what you want you need to add a new calculated field to your form's or report's record source and use a dCount to see if you have a duplicate on the two field combination:
    Dup:dCount("*","tblYourTable","DateField=#" & [DateField] & "# AND [Event] = '" & [Event] & "'")

    Now use this new field in the conditional formatting expression (If [Dup]>0 ----TURN RED).

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    perryc is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2019
    Posts
    122
    yeah, I thought that is not the same concept as excel. Ty. I will paly with your hint.

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

Similar Threads

  1. Conditional Format assistance
    By Kirnicko in forum Forms
    Replies: 14
    Last Post: 02-09-2021, 08:31 PM
  2. Conditional report format in vba
    By skyatis in forum Reports
    Replies: 4
    Last Post: 01-20-2017, 01:00 AM
  3. Conditional formatting to compare rows on a form
    By william barker in forum Forms
    Replies: 1
    Last Post: 01-03-2017, 01:24 PM
  4. combobox + conditional format
    By markjkubicki in forum Forms
    Replies: 4
    Last Post: 06-24-2014, 04:25 PM
  5. Conditional number format
    By terryvanduzee in forum Forms
    Replies: 1
    Last Post: 07-14-2011, 01:29 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