Cond. Formatting

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Is there a chance to bind 6 conditions to a textfield.

For instance, if "X field" values are:

0 to 15 = 1 (white)
16 to 30 = 2 (grey)
31 to 45 = 3 (red)
46 to 60 = 4 (yellow)
61 to 75 = 5 (orange)
76 to 100 = 6 (green)



Thanks,
Tom
 
I guess you could put it in the vba code in the ONCURRENT event.

Rick B

Is there a chance to bind 6 conditions to a textfield.

For instance, if "X field" values are:

0 to 15 = 1 (white)
16 to 30 = 2 (grey)
31 to 45 = 3 (red)
46 to 60 = 4 (yellow)
61 to 75 = 5 (orange)
76 to 100 = 6 (green)



Thanks,
Tom
 
Rick:

Thanks... do you know what the property name ("backcolor" or something like
that) that I need to use for that?

Thanks,
Tom
 
something like...

Me!MyFieldName.BackColor = "255" ' Red


Rick B

16777215 = white
8421504 = gray
65535 = yellow
33023 = orange
32768 = green


Rick:

Thanks... do you know what the property name ("backcolor" or something like
that) that I need to use for that?

Thanks,
Tom
 
Rick:

That works great... thanks for the info.

One more question though... I also want the "font color" to change to the
same color as the "back color". I tried "Forecolor"... that didn't seem to
work though.

Any suggestions? Essentially, the information is pulled from a table. I
doubt that I'll make changes in the form itself... basically, the table
value drives the color but the value should not be displayed in the form.

Thanks in advance,
Tom
 
I just tried

Me!MyFieldName.BackColor = "####"

and it worked. Are you sure you did not mistype it?

Rick B



Rick:

That works great... thanks for the info.

One more question though... I also want the "font color" to change to the
same color as the "back color". I tried "Forecolor"... that didn't seem to
work though.

Any suggestions? Essentially, the information is pulled from a table. I
doubt that I'll make changes in the form itself... basically, the table
value drives the color but the value should not be displayed in the form.

Thanks in advance,
Tom
 
Rick:

Yes, the "Me!MyFieldName.BackColor = "####" works fine.

I changed this to CASE: "Me!MyFieldName.BackColor = "255" AND
"Me!MyFieldName.ForeColor = "255"

Because of the added "Forecolor", this actually turns "black".

Any idea why?


Tom
 
Well, I would think that you would not want your foregroung color and youe
background color to be the same.

Never tried that before. Seems it would just be a red box.

Rick B


Rick:

Yes, the "Me!MyFieldName.BackColor = "####" works fine.

I changed this to CASE: "Me!MyFieldName.BackColor = "255" AND
"Me!MyFieldName.ForeColor = "255"

Because of the added "Forecolor", this actually turns "black".

Any idea why?


Tom
 
Back
Top