Share via

Access conditional formatting

Anonymous
2011-07-11T04:46:46+00:00

I have a straight forward conditional format --- if Field1 not equal Field 2 print Field1 in red. It doesn't get much more basic than that and it does what it's supposed to do... most of the time.  For some reason, every once in a while it will print in red even though the number are equal. Field2 is a calculated field so I tried Field1 not equal (Part1 + Part2 + Part3) again - works most of the time but the same errors. I thought maybe it was a rounding error so I made sure all my fields were formatted standard and set to 2 decimals. Same thing. I tried formating them out to 10 decimal places and they were equal but it printed red. I tried coming at it from the other direction and setting everythng to print in red then said print in black if equal. That gave me the same errors. I even tried removing the conditional formatting altogether and using VBA to set the forecolor. That gave me the same errors as well. It is always the same records that print wrong no matter how I approach it. What am I missing here? Is there a bug in Access that I don't know about? I'm still using 2003 (SP3). Any ideas?

TIA. Lynne

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2011-07-12T23:51:35+00:00

How about this:

Expression Is;  CLng([Field1]*100) <> CLng([Field2]*100)

Was this answer helpful?

0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2011-07-13T18:03:22+00:00

    That works! You are brilliant! Thanks so much!

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2011-07-12T19:19:17+00:00

    I tried this as well as the suggestion made by John Spencer. I still get records printing in red when the amounts are equal. It is always the same records that print incorrectly whether I use the conditional formatting or VBA. I have gone back to my raw data and confirmed the amounts are equal. Any other ideas? This is such a simple thing to be spending so much time on but it is driving me crazy.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2011-07-11T13:42:44+00:00

    Or change the conditional expression to

    Expression Is;  Abs([Field1]-[Field2]) < .0001

    Was this answer helpful?

    0 comments No comments
  4. ScottGem 68,830 Reputation points Volunteer Moderator
    2011-07-11T12:52:32+00:00

    Formatting and rounding are different things. Formatting doesn't change the value. So if the values are not the same to the last decimal place it will show as Red.

    Change your expression in the Conditional Form to:

    Round(Field1,2) <> Round(Field2,2)

    Was this answer helpful?

    0 comments No comments