Conditional formatting sees a difference between numbers that visually look the same

时间:2016-04-21 22:33:23

标签: ms-access ms-access-2013

In Microsoft Access 2013, I have 2 textboxes on a form containing Currency format and 2 decimals that I compare.

For example: $25,100.50

If the numbers are visually identical, I expect the comparison box to turn green. If they are visually different, I expect the comparison box to turn red. However, the box often turns red even though the number is visually identical. Obviously, it is comparing the rolled up decimals. If I make sure the format is currency, and the decimal places are the same, shouldn't that take care of it? How can I tweak this so that it works every time?

1 个答案:

答案 0 :(得分:2)

Instead of having the conditional formatting expression

Textbox1 = Textbox2

Use

Format(Textbox1,"Currency") = Format(Textbox2, "Currency")