Change font color

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an iif statement
=IIf([Closed1]=-1,"Closed","Open")

If closed appears I want it to be red
If open appears I want it to be green

How can I do this
 
Hi Chey

Two methods:

1. Set the ForeColor of your textbox to green, then go to Format>Conditional
formatting...
Under "Condition 1" select "Expression Is" from the dropdown and in the
box type:
[Closed1]=-1
Then set the font colour to red.

2. Assuming Closed1 is a yes/no field, you can do it with a simple format.
Just set the ControlSource of your textbox to Closed1 and set the Format to:
;[Red]"Closed";[Green]"Open"
You probably also want to set Enabled to No and Locked to Yes.
 
If you are talking about a Form or Report, then check conditional formating

Open the Form/Report in design view, select the field you want to format,
from the
menu bar select Format > Conditional Formating

Select the color and the condition
 
okay that worked great. Now can I throw something else in there. Can I make
close blink? I am trying to get it to draw attention.

Graham Mandeno said:
Hi Chey

Two methods:

1. Set the ForeColor of your textbox to green, then go to Format>Conditional
formatting...
Under "Condition 1" select "Expression Is" from the dropdown and in the
box type:
[Closed1]=-1
Then set the font colour to red.

2. Assuming Closed1 is a yes/no field, you can do it with a simple format.
Just set the ControlSource of your textbox to Closed1 and set the Format to:
;[Red]"Closed";[Green]"Open"
You probably also want to set Enabled to No and Locked to Yes.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Chey said:
I have an iif statement
=IIf([Closed1]=-1,"Closed","Open")

If closed appears I want it to be red
If open appears I want it to be green

How can I do this
 
If you have a continuous form (displaying more than one record) the answer
is "No".

The only way to make something blink in Access is to use a Timer event on
the form to switch the ForeColor from what it was, to the same as the
BackColor, then back again.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Chey said:
okay that worked great. Now can I throw something else in there. Can I
make
close blink? I am trying to get it to draw attention.

Graham Mandeno said:
Hi Chey

Two methods:

1. Set the ForeColor of your textbox to green, then go to
Format>Conditional
formatting...
Under "Condition 1" select "Expression Is" from the dropdown and in
the
box type:
[Closed1]=-1
Then set the font colour to red.

2. Assuming Closed1 is a yes/no field, you can do it with a simple
format.
Just set the ControlSource of your textbox to Closed1 and set the Format
to:
;[Red]"Closed";[Green]"Open"
You probably also want to set Enabled to No and Locked to Yes.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Chey said:
I have an iif statement
=IIf([Closed1]=-1,"Closed","Open")

If closed appears I want it to be red
If open appears I want it to be green

How can I do this
 

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

Back
Top