Conditional Format or VBA

  • Thread starter Thread starter Chad
  • Start date Start date
C

Chad

Hello, I have a few text and combo boxes on my form that I want to have the
color change to red if there isnt any information selected in them. I was
going to use conditional formating but it only lets you use 3 Expresion is
and I have a few that need to cange red. I also wanted one of my text boxes
that have a value in it already that is 0.00 and if its that it will change
red but if there is a nember in it then it is normal. I dont know how to do
this? I was going to use IsNull([fieldName])=True in the expression is but
like I said I have about 5 text and combo boxes that need to turn red and one
with the 0.00 in in as well. how would I do this? Thanks!
 
Each control has its own set of conditional formats, so you can have up to 3
conditional formats for any control.

If you are saying that you want to change 5 controls based on the values of
any of the 5 controls that can be done also, by using a more complex
expression of by constructing a VBA function that returns true or false and
using that expression in EACH of the controls conditional formatting.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
There are actually 4 possible conditions.
Condition 1, Condition 2, Condition 3, and the default or what the condition
is set to in design view.
--
Dave Hargis, Microsoft Access MVP


John Spencer said:
Each control has its own set of conditional formats, so you can have up to 3
conditional formats for any control.

If you are saying that you want to change 5 controls based on the values of
any of the 5 controls that can be done also, by using a more complex
expression of by constructing a VBA function that returns true or false and
using that expression in EACH of the controls conditional formatting.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Chad said:
Hello, I have a few text and combo boxes on my form that I want to have
the
color change to red if there isnt any information selected in them. I was
going to use conditional formating but it only lets you use 3 Expresion is
and I have a few that need to cange red. I also wanted one of my text
boxes
that have a value in it already that is 0.00 and if its that it will
change
red but if there is a nember in it then it is normal. I dont know how to
do
this? I was going to use IsNull([fieldName])=True in the expression is but
like I said I have about 5 text and combo boxes that need to turn red and
one
with the 0.00 in in as well. how would I do this? Thanks!
 
Ok, so I can use conditional formating for each control (Great), I will use
IsNull([fieldName])=True for the needed ones but what formula would I use for
the text box that holds a value of 0.00? I want this box to turn red if 0.00
is there and for it not to be red if there is anything else other than that.
Thanks!
 
Im not good a writing code could you give me an example of what you mean?
Thanks!
--
Newbies need extra loven.........


Klatuu said:
Select Field Value Is, Eqaul To, and 0
--
Dave Hargis, Microsoft Access MVP


Chad said:
Ok, so I can use conditional formating for each control (Great), I will use
IsNull([fieldName])=True for the needed ones but what formula would I use for
the text box that holds a value of 0.00? I want this box to turn red if 0.00
is there and for it not to be red if there is anything else other than that.
Thanks!
 
No code required.

Right click on the control you want to format. Select Conditional
Formatting. The conditional formatting dialog will pop up. Make the
selections as listed in my previous post.

--
Dave Hargis, Microsoft Access MVP


Klatuu said:
Select Field Value Is, Eqaul To, and 0
--
Dave Hargis, Microsoft Access MVP


Chad said:
Ok, so I can use conditional formating for each control (Great), I will use
IsNull([fieldName])=True for the needed ones but what formula would I use for
the text box that holds a value of 0.00? I want this box to turn red if 0.00
is there and for it not to be red if there is anything else other than that.
Thanks!
 
I had t read that post a few times but I get what your saying... Works great!
Thanks!
--
Newbies need extra loven.........


Klatuu said:
No code required.

Right click on the control you want to format. Select Conditional
Formatting. The conditional formatting dialog will pop up. Make the
selections as listed in my previous post.

--
Dave Hargis, Microsoft Access MVP


Klatuu said:
Select Field Value Is, Eqaul To, and 0
--
Dave Hargis, Microsoft Access MVP


Chad said:
Ok, so I can use conditional formating for each control (Great), I will use
IsNull([fieldName])=True for the needed ones but what formula would I use for
the text box that holds a value of 0.00? I want this box to turn red if 0.00
is there and for it not to be red if there is anything else other than that.
Thanks!
 
Klatuu, For some reason the IsNull([txtFootage])=True ect. for the other text
boxes isnt working? Is the code correct? Thanks!
 
I got it with IsNull([txtFootage]).... Same thing! Thanks for the reply!
--
Newbies need extra loven.........


Steve Schapel said:
Chad,

Correct syntax would be:
[txtFootage] Is Null

--
Steve Schapel, Microsoft Access MVP
Klatuu, For some reason the IsNull([txtFootage])=True ect. for the other text
boxes isnt working? Is the code correct? Thanks!
 
Back
Top