Zeroanarchy,
When you refer to the backcolor,
Code:
If test = 1 Then
Phone.BackColor = RGB(255, 0, 0)
you are referring to a property, not a value.
The key to making this work is to not change properties at all....change the values. Let's take it from your original post:
Code:
If [2] >= 1 Then
Me![2].BackColor = RGB(255, 0, 0)
Put a new text box on your form.
Name it txtBackColor.
Set its forecolor to red.
backstyle to transparent
special effect to flat
border style to transparent
font to Terminal
Paste the following into the control source of txtBackColor. This assumes that the textbox you're checking is named [2] and that 'greater than one' is your test.
Code:
=IIf([2]>1,"ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ","")
This will change the
value of txtBackColor to the characters above whenever the value of [2] is greater than 1. These particular characters in the Terminal font are displayed as a solid block of red. If the value of [2] is less than one, then the value of txtBackColor will be a zero length string. Since all of the properties for this text box are set to transparent, you will not see it on the form when it is a zero length string.
I realize that this is a bit strange; changing values of one text box to simulate property changes on another text box. In fact, I guess, we're cheating. We're getting an Access 2000 feature out of Access '97.
Good for us!
The fact is that you probably do not want to leave the properties of this text box transparent, but this is the most clear-cut example. You chould size this txtBackColor to be the same as [2] with the same background and border. Keep the font at Terminal and the forecolor set to Red. Set it right on top of [2] and then, from the menu, select Format and Send to Back. Click somewhere else on the form to get the focus off of txtBackColor and then select [2]. Set the border and backstyle to transparent for [2].
When you look at the form view, [2] should still look the same as before. Be sure to set txtBackColor's tab stop property to "No" and set it's OnGotFocus event to
Let me know how it works.
John
Use what you have,
Learn what you can,
Create what you need.