Conditional Formatting a calculated control

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

I have a control on a form which displays the number of
days which have passed since an event took place. The
formula is "=Date()-[Date_Clock]". I am trying to apply
conditional formatting so that if the result is >=16 the
forecolor is Red, if it is >=9 it is Yellow otherwise, it
is Green. In each case I want the background to be
transparent.

The Conditional Formatting option does not seem to work
and I suspect htis is because it is a calculated control.

Does anyone know a way round this?
 
I show it should work on a calculated control. I just tried the settings you
mention and got the results you say you expect. Are you getting the correct
value in the textbox?
 
Yes, the correct value is being shown. The conditional
bit seems to work as the text is turning red at 16 and
Yellow at 10 but the less than 10 keeps turning red as
well. I have tried setting a third condition and also
setting the default to green but neither seems to work.
Could it be to do with the background to the form (which
is blends)?

-----Original Message-----
I show it should work on a calculated control. I just tried the settings you
mention and got the results you say you expect. Are you getting the correct
value in the textbox?

--
Wayne Morgan
Microsoft Access MVP


I have a control on a form which displays the number of
days which have passed since an event took place. The
formula is "=Date()-[Date_Clock]". I am trying to apply
conditional formatting so that if the result is >=16 the
forecolor is Red, if it is >=9 it is Yellow otherwise, it
is Green. In each case I want the background to be
transparent.

The Conditional Formatting option does not seem to work
and I suspect htis is because it is a calculated control.

Does anyone know a way round this?


.
 
Following on from my last response, could access be
treating my result as text, rather than numeric, so
numbers 2-9 are being considered higher than 16?

-----Original Message-----
Yes, the correct value is being shown. The conditional
bit seems to work as the text is turning red at 16 and
Yellow at 10 but the less than 10 keeps turning red as
well. I have tried setting a third condition and also
setting the default to green but neither seems to work.
Could it be to do with the background to the form (which
is blends)?

-----Original Message-----
I show it should work on a calculated control. I just tried the settings you
mention and got the results you say you expect. Are you getting the correct
value in the textbox?

--
Wayne Morgan
Microsoft Access MVP


I have a control on a form which displays the number of
days which have passed since an event took place. The
formula is "=Date()-[Date_Clock]". I am trying to apply
conditional formatting so that if the result is >=16 the
forecolor is Red, if it is >=9 it is Yellow otherwise, it
is Green. In each case I want the background to be
transparent.

The Conditional Formatting option does not seem to work
and I suspect htis is because it is a calculated control.

Does anyone know a way round this?


.
.
 
I don't know if Conditional Formatting would do that or not, but it may be
worth checking. There is an option to put an expression in instead of a
value. You may want to try an expression similar to

CInt(NameOfControl)>16

or, perhaps in the equation in the textbox's control source, try wrapping
the equation in CInt(). Change CInt to the correct data type for what you
are doing (i.e. CLng, CByte, CSng, etc)

--
Wayne Morgan
Microsoft Access MVP


Tim said:
Following on from my last response, could access be
treating my result as text, rather than numeric, so
numbers 2-9 are being considered higher than 16?

-----Original Message-----
Yes, the correct value is being shown. The conditional
bit seems to work as the text is turning red at 16 and
Yellow at 10 but the less than 10 keeps turning red as
well. I have tried setting a third condition and also
setting the default to green but neither seems to work.
Could it be to do with the background to the form (which
is blends)?

-----Original Message-----
I show it should work on a calculated control. I just tried the settings you
mention and got the results you say you expect. Are you getting the correct
value in the textbox?

--
Wayne Morgan
Microsoft Access MVP


I have a control on a form which displays the number of
days which have passed since an event took place. The
formula is "=Date()-[Date_Clock]". I am trying to apply
conditional formatting so that if the result is >=16 the
forecolor is Red, if it is >=9 it is Yellow otherwise, it
is Green. In each case I want the background to be
transparent.

The Conditional Formatting option does not seem to work
and I suspect htis is because it is a calculated control.

Does anyone know a way round this?



.
.
 
Back
Top