Formatting one field based on the value in another field.

G

Guest

I am trying to to format the backcolor of a text box based on the value in
another text box. For instance the value in text box 50 is "1", so the
backcolor of Text1 should be vbBlue. I am trying to write this into the Code
window but so far I have been unsuccessful in getting it to work. Any
suggestions?
 
R

Rick B

If it were me, I'd use the built-in conditional formatting features of
Access. Format/Conditional Formatting...

Change the first drop-down to "Expression Is" and then enter the expression
you wnat to use.

Rick B
 
G

Guest

That would work if I was trying to change the format of the field based on
the value in that field, but I am trying to change the back color based on
the value in a DIFFERENT field.
 
R

Rick B

CHANGE THE DROP DOWN TO "EXPRESSION IS" then you can enter any expression
you want....

=[SomeFiledName] <1


=[SomeField] <> [SomeOtherField]

etc.
 
R

Rick B

don't use the equal sign though.


Rick B


Rick B said:
CHANGE THE DROP DOWN TO "EXPRESSION IS" then you can enter any expression
you want....

=[SomeFiledName] <1


=[SomeField] <> [SomeOtherField]

etc.



Larry G. said:
That would work if I was trying to change the format of the field based on
the value in that field, but I am trying to change the back color based on
the value in a DIFFERENT field.
 
G

Guest

THANK YOU! THANK YOU! THANK YOU!~~~~

Rick B said:
CHANGE THE DROP DOWN TO "EXPRESSION IS" then you can enter any expression
you want....

=[SomeFiledName] <1


=[SomeField] <> [SomeOtherField]

etc.



Larry G. said:
That would work if I was trying to change the format of the field based on
the value in that field, but I am trying to change the back color based on
the value in a DIFFERENT field.
 
S

Scuda

Hi All, trying to do something like this and I am getting stuck.

I have a combo box and a text box right next to it for comments. When "UC"
is selected within the combo box, I would like the text box NEXT to it to
turn red. I have tried pretty much all I can think of and I am stuck!!

Thanks so much.

Steph
 
R

Roger Carlson

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

Top