Access Conditional formatting

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,347
Office Version
  1. 365
Platform
  1. Windows
I have a bunch of fields on a form where I entered conditional formula

"Check values in the current record or use and expression
Format on cells where the:
Field Value is greater than 0


Then the formatting is set to make the fore color red

if the value, which is calculated, results in 0 it stays black, if its greater than 0 it turns red BUT if its a negative number (like -1) it turns red. negative 1 is less than 0 so it should stay black. What am I doing incorrectly?

I tried "0" which not difference on results
 
Last edited:

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Click on the Refresh Button and see if that makes a difference.
 
Upvote 0
Does the same for me in 2007.

However if you change it to Expression Is and then the formula like [txtColour]>0 it will do as you wish.

HTH
 
Upvote 0
When you state (txtColor] do you mean a color or are you saying to you want like [Red]>0?

if I but [textcolor]>0 and then go below that section and select red from the color pallet nothing happens when the condition is met
 
Upvote 0
No, [txtColour] is the name of the control you are checking to see if the value is > 0
I just created a form and put one control on it called txtColour.
 
Upvote 0
not seeing any different. can you please explain me again.

The expression will check the sign of the value in the field.
If the value in the field is negative it will evaluate to -1
if field value is Zero then sgn() function will return 0

if the field value is a positive number then sgn() will return +1

Based on this three returned values (-1, 0 or 1) you can define the color of the field value you want.
 
Upvote 0
What benefit is there of adding extra code of the sgn function when testing the value will do the same?
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,248
Members
452,623
Latest member
cliftonhandyman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top