conditional formating text

CdRsKuLL

Registered User.
Local time
Today, 14:21
Joined
Nov 30, 2009
Messages
17
I am trying to format a text box so when it contains either "HH" , "HA" or "HP" it turns blue.

I assume I use the expression is box... I've tried Like "H*" but that doesn't work..

can anyone offer some advice ?

Many thanks

Steve
 
Put something like this on the OnCurrent of your form and AfterUpdate of the textbox:

If Me!cbox Like "H*" Then
Me!cbox.BackColor = 16744448
Else
Me!cbox.BackColor = 16777215
End If

Note: Change cbox to your textbox name and change the number values to what ever colour value you require
 
Expression Is

[TextBoxName] = "HH" or [TextBoxName] = "HA" or [TextBoxName] = "HP"

Note that James' type of code can only be used in a Single View Form, not in a Datasheet or Continuous View Form.
 
Thanks guys..

Ii ended up using [textbox] Like "H*" but is a bit of a pain as I have 31 boxes to do.

Steve
 
I could be wrong....but you might be able to use format painter. So if you've got one right, it may be a quick way of doing the other 30.
 
It's a bit strange that you have 31 textboxes which all can contain the same data!

Neverless, you can select all 31 controls and set the Conditional Formatting at once.
 

Users who are viewing this thread

Back
Top Bottom