Conditional Formatting Question MS Access 20002

B

bcfreeze

I have a date field in a report that changes color depending on a date - so
many days. This works fine. But I need to also have the color change based on
a date field in another column. I have tried setting conditional formatting
like this.

[operations accept] >= 01/01/2000

this does not work however. Can you tell me how I can set this. This is
condition 3 by the way. Also what is condition 3 the last condition to be met
so that it would over rule condition 2 to change the color.
Thanks in advance.
 
M

Marshall Barton

bcfreeze said:
I have a date field in a report that changes color depending on a date - so
many days. This works fine. But I need to also have the color change based on
a date field in another column. I have tried setting conditional formatting
like this.

[operations accept] >= 01/01/2000

this does not work however. Can you tell me how I can set this. This is
condition 3 by the way. Also what is condition 3 the last condition to be met
so that it would over rule condition 2 to change the color.


When you use a literal date in an expression, query or code,
it must be enclosed on # signs and be US style (m/d/y) or in
an unambiguous style (e.g. y-m-d)

Change your expression to:
[operations accept] >= #01/01/2000#
 
B

bcfreeze

I have tried that but it does not work. The way the conditions work is this.
On the [TCCC Date] field
condition 1
Field Value is Between (Date ( ) -14) and Date ( ) This Colors Yellow

Condition 2
Field Value is Between (Date ( ) -14 and Date ( ) -120) This colors Red

Condition 3 would be the one that I want to take the condition off the
[Operations Accept] field so that the yellow and red will not show up in the
[TCCC Date] field if there is a date in [Operations Accept] field.



Marshall Barton said:
bcfreeze said:
I have a date field in a report that changes color depending on a date - so
many days. This works fine. But I need to also have the color change based on
a date field in another column. I have tried setting conditional formatting
like this.

[operations accept] >= 01/01/2000

this does not work however. Can you tell me how I can set this. This is
condition 3 by the way. Also what is condition 3 the last condition to be met
so that it would over rule condition 2 to change the color.


When you use a literal date in an expression, query or code,
it must be enclosed on # signs and be US style (m/d/y) or in
an unambiguous style (e.g. y-m-d)

Change your expression to:
[operations accept] >= #01/01/2000#
 
B

bcfreeze

One more thing. The expression works for most of the report using [Operations
Accept] >= #01/01/2001#

But for some reason there are entries in that field that the condition isnt'
picking up. Any ideas as to why.

But there are rows that it is not working in. I can't seem to figure that
one out. The way the Condition works if there is a date there it should color
the field white as I have set in the condition 3.

bcfreeze said:
I have tried that but it does not work. The way the conditions work is this.
On the [TCCC Date] field
condition 1
Field Value is Between (Date ( ) -14) and Date ( ) This Colors Yellow

Condition 2
Field Value is Between (Date ( ) -14 and Date ( ) -120) This colors Red

Condition 3 would be the one that I want to take the condition off the
[Operations Accept] field so that the yellow and red will not show up in the
[TCCC Date] field if there is a date in [Operations Accept] field.



Marshall Barton said:
bcfreeze said:
I have a date field in a report that changes color depending on a date - so
many days. This works fine. But I need to also have the color change based on
a date field in another column. I have tried setting conditional formatting
like this.

[operations accept] >= 01/01/2000

this does not work however. Can you tell me how I can set this. This is
condition 3 by the way. Also what is condition 3 the last condition to be met
so that it would over rule condition 2 to change the color.


When you use a literal date in an expression, query or code,
it must be enclosed on # signs and be US style (m/d/y) or in
an unambiguous style (e.g. y-m-d)

Change your expression to:
[operations accept] >= #01/01/2000#
 
M

Marshall Barton

bcfreeze said:
I have tried that but it does not work. The way the conditions work is this.
On the [TCCC Date] field
condition 1
Field Value is Between (Date ( ) -14) and Date ( ) This Colors Yellow

Condition 2
Field Value is Between (Date ( ) -14 and Date ( ) -120) This colors Red

Condition 3 would be the one that I want to take the condition off the
[Operations Accept] field so that the yellow and red will not show up in the
[TCCC Date] field if there is a date in [Operations Accept] field.


Well, that's a different question. Assuming the text box
has its color set to white, this arrangement has only two
results (red and yellow) so you should use two conditions.

Condition 1
Expression Is: [Operations Accept] Is Null AND [TCCC Date]
Between Date() -14 And Date()
Color: Yellow

Condition 2
Expression Is: [Operations Accept] Is Null AND [TCCC Date]
Between Date() -120 And Date() -15
Color: Red

If you really had a condition that overrode other
conditions, then the overriding condition needs to be before
the other conditions. It's not needed in this case, but you
could use:

Condition 1
Expression Is: [Operations Accept] Is Not Null
Color: White

Condition 2
Value Is: Between Date() -14 And Date()
Color: Yellow

Condition 3
Value Is: Between Date() -120 And Date() -15
Color: Red

Generally, you should not use more conditions than required
because there are only three allowed and because they have a
performance penalty.
 
B

bcfreeze

Thanks Marshall worked like a charm. I never thought of using the conditions
that way. If a person wanted to change the color of each one to say green if
the [Operations Accept] was not null can that be done from the same
expressions? We are using the default of white. More interested in knowing
how to change the color in the expression aside from what is visible on the
screen.

Marshall Barton said:
bcfreeze said:
I have tried that but it does not work. The way the conditions work is this.
On the [TCCC Date] field
condition 1
Field Value is Between (Date ( ) -14) and Date ( ) This Colors Yellow

Condition 2
Field Value is Between (Date ( ) -14 and Date ( ) -120) This colors Red

Condition 3 would be the one that I want to take the condition off the
[Operations Accept] field so that the yellow and red will not show up in the
[TCCC Date] field if there is a date in [Operations Accept] field.


Well, that's a different question. Assuming the text box
has its color set to white, this arrangement has only two
results (red and yellow) so you should use two conditions.

Condition 1
Expression Is: [Operations Accept] Is Null AND [TCCC Date]
Between Date() -14 And Date()
Color: Yellow

Condition 2
Expression Is: [Operations Accept] Is Null AND [TCCC Date]
Between Date() -120 And Date() -15
Color: Red

If you really had a condition that overrode other
conditions, then the overriding condition needs to be before
the other conditions. It's not needed in this case, but you
could use:

Condition 1
Expression Is: [Operations Accept] Is Not Null
Color: White

Condition 2
Value Is: Between Date() -14 And Date()
Color: Yellow

Condition 3
Value Is: Between Date() -120 And Date() -15
Color: Red

Generally, you should not use more conditions than required
because there are only three allowed and because they have a
performance penalty.
 
M

Marshall Barton

bcfreeze said:
Thanks Marshall worked like a charm. I never thought of using the conditions
that way. If a person wanted to change the color of each one to say green if
the [Operations Accept] was not null can that be done from the same
expressions? We are using the default of white. More interested in knowing
how to change the color in the expression aside from what is visible on the
screen.


If you want a third color, then you need three conditions as
I explained in my earlier reply.

The property settings can not be changed in the expression.
 
B

bcfreeze

That is what I thought. Thanks for the help Marshall.

Marshall Barton said:
bcfreeze said:
Thanks Marshall worked like a charm. I never thought of using the conditions
that way. If a person wanted to change the color of each one to say green if
the [Operations Accept] was not null can that be done from the same
expressions? We are using the default of white. More interested in knowing
how to change the color in the expression aside from what is visible on the
screen.


If you want a third color, then you need three conditions as
I explained in my earlier reply.

The property settings can not be changed in the expression.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top