Access Conditional formatting

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,332
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

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
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,213,485
Messages
6,113,931
Members
448,533
Latest member
thietbibeboiwasaco

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