Tips & tricks conditional formatting

  • Thread starter Thread starter a
  • Start date Start date
A

a

Tips & tricks conditional formatting

I have txtbox1 I do for this text box conditional format

Expression

Txtbox1=txtbox1

Formating

Font:Bold Color: Red

This code work very good to color txtbox1 in the subform give me nice idea
to color column

My Question is:

1-Why this Expression Work Correctly?

2- this code work if there is a value in the text box if there is no value
the txtbox1 become white the default !!! My question is how also color the
txtbox1 where is no value?
 
Mr.

John W. Vinson [MVP]

How are you I'm happy to hear from you .. You are really Very good Man



I do what you say and I understand that control=control as 1=1



If you always want the textbox red, whatever value it contains, just set the
textbox's properties and don't use conditional formatting at all!

Do You mean using Continuous form if it is



Can you tell me how can I do that in Datasheet form? Coloring one column if
contain a value or not contain
 
Tips & tricks conditional formatting

I have txtbox1 I do for this text box conditional format

Expression

Txtbox1=txtbox1

Formating

Font:Bold Color: Red

This code work very good to color txtbox1 in the subform give me nice idea
to color column

My Question is:

1-Why this Expression Work Correctly?

2- this code work if there is a value in the text box if there is no value
the txtbox1 become white the default !!! My question is how also color the
txtbox1 where is no value?

If you always want the textbox red, whatever value it contains, just set the
textbox's properties and don't use conditional formatting at all!

It's working when the textbox contains data because that expression is TRUE
for all values - every number is equal to itself. It will not work when the
value is NULL such as the new record, because NULL is not equal (or unequal)
to anything.
 
For datasheet view you need to use the conditional formating.


Now for the null condition..

1) Add a second conditional formating test to the field.
isnull([txtbox1]) = true and set
the formating to the same as the previous.

or

isnull([txtbox1]) and set
the formating to the same as the previous

either of the above should work.

Ron
 
Can you tell me how can I do that in Datasheet form? Coloring one column if
contain a value or not contain

I almost never use datasheets, so I'm not sure: maybe conditional formatting
would work. Try a Condition of

True

so it will be true no matter what's in your table!
 
For Datasheet, conditional is the only one that will work. I have to
use it all the time, although usually I use it only to highlight
different conditions.

Ron
 
Back
Top