Formatting one field based on the value in another field.

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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
 
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.
 
CHANGE THE DROP DOWN TO "EXPRESSION IS" then you can enter any expression
you want....

=[SomeFiledName] <1


=[SomeField] <> [SomeOtherField]

etc.
 
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.
 
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.
 
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
 
Back
Top