Jeremy Campbell
asked on
Trying to change color of text in Access form on textbox using conditional formatting.
I have a textbox called RESULT. It is always a number that is keyed in here.
There is also a PLUS field and a MINUS field that both return numbers.
I want to set conditional formatting to say that when the number in RESULT is greater than PLUS or LESS than MINUS then highlight the text red.
I started out by just trying to get the plus side working so I created this;
It seems to have a problem with numbers that contain decimals.
So when I have a RESULT that is .940 and the PLUS number is .950 it will not highlight the RESULT Red until it is 1.000 or greater.. I would expect it to highlight when it is greater than .950.. So .9501 should highlight red.
Thanks in advance for the help!
There is also a PLUS field and a MINUS field that both return numbers.
I want to set conditional formatting to say that when the number in RESULT is greater than PLUS or LESS than MINUS then highlight the text red.
I started out by just trying to get the plus side working so I created this;
It seems to have a problem with numbers that contain decimals.
So when I have a RESULT that is .940 and the PLUS number is .950 it will not highlight the RESULT Red until it is 1.000 or greater.. I would expect it to highlight when it is greater than .950.. So .9501 should highlight red.
Thanks in advance for the help!
<RESULT that is .940 and the PLUS number is .950 it will not highlight the RESULT Red>
.940 is less than .950
.940 is less than .950
ASKER
ASKER
<RESULT that is .940 and the PLUS number is .950 it will not highlight the RESULT Red>
Sorry that may have not made any since..
Basically when the result is not falling within the range then I would like for it to highlight red..
Sorry that may have not made any since..
Basically when the result is not falling within the range then I would like for it to highlight red..
ASKER
Oh and in the picture the plus and minus labels should be switched..
ASKER
Maybe my PLUS and MINUS fields are note being treated as numbers but rather text? They are created using some VBA that I'm still tweaking on another question.
Can I do something like set up a textbox that will convert them to a number that goes to 4 decimal places?
NewPLUS= ToNumber([PLUS], 0000.0000) ? Something like this perhaps?
Can I do something like set up a textbox that will convert them to a number that goes to 4 decimal places?
NewPLUS= ToNumber([PLUS], 0000.0000) ? Something like this perhaps?
<RESULT is greater than PLUS or LESS than MINUS then highlight the text red.>
setting
expression is [Result]>[Plus] Or [Result]<[Minus]
<Basically when the result is not falling within the range then I would like for it to highlight red..>
the setting will be
expression is [Result]>[Plus] And [Result]<[Minus]
setting
expression is [Result]>[Plus] Or [Result]<[Minus]
<Basically when the result is not falling within the range then I would like for it to highlight red..>
the setting will be
expression is [Result]>[Plus] And [Result]<[Minus]
ASKER
sorry
the setting will be
expression is [Minus] > [Result] Or [Plus] < [Result]
the same as
expression is [Result]>[Plus] Or [Result]<[Minus]
the setting will be
expression is [Minus] > [Result] Or [Plus] < [Result]
the same as
expression is [Result]>[Plus] Or [Result]<[Minus]
What is the data type of these fields? If they are text fields, you could convert their values to Double values for comparison.
ASKER
I'm convinced these fields need to be converted to numbers.. Not sure how to do that though.. It needs to handle up to 0000.0000 if possible..
ASKER
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
or this
expression is CDbl([Minus]) > CDbl([Result]) Or CDbl([Plus]) < CDbl([Result])
expression is CDbl([Minus]) > CDbl([Result]) Or CDbl([Plus]) < CDbl([Result])
ASKER
That did the trick! Now its working:)
expression is [Result]>[Plus] Or [Result]<[Minus]