textbox background color

bpich

New member
Local time
Today, 12:34
Joined
Oct 9, 2015
Messages
1
Hello,
I have a textbox in a form that contains numerical data. I'd like to change the background color to orange when the number is over 30.
Thanks for helping
 
Look at the conditional Formatting option - that will let you do what you need.
 
another way to make it is to add one code after update of the text box

Code:
if int(me.textboxname.value) > 30 then
me.textboxname.BackColor = vbred
else
me.textboxname.BackColor = vbwhite
this way can be easier to control for me if there are not mathematical conditrion like on enter, on focus, on exit....
 
another way to make it is to add one code after update of the text box

Code:
if int(me.textboxname.value) > 30 then
me.textboxname.BackColor = vbred
else
me.textboxname.BackColor = vbwhite
this way can be easier to control for me if there are not mathematical conditrion like on enter, on focus, on exit....

Changing the color this way is only good for a simple form view.
In a continuous view it will change the color of all cells of this field, not this specific value.
 
Changing the color this way is only good for a simple form view.
In a continuous view it will change the color of all cells of this field, not this specific value.

OT:good to know, thanks
 

Users who are viewing this thread

Back
Top Bottom