A
Allen
I have a Form with a subform that is in a continues view.
In the subform I wanted a TextBox to change colors
depending on a value of another box. This is my code.
Private Sub Form_Current()
If [OPS] = 1 Then
[TBC].Visible = False
End If
If [OPS] = 2 Then
[TBC].BackColor = 13434828
[TBC].Visible = True
End If
If [OPS] = 3 Then
[TBC].BackColor = 9868950
[TBC].Visible = True
End If
If [OPS] = 4 Then
[TBC].BackColor = 52479
[TBC].Visible = True
End If
If [OPS] = 5 Then
[TBC].BackColor = 16751052
[TBC].Visible = True
End If
If [OPS] = 6 Then
[TBC].BackColor = 13421619
[TBC].Visible = True
End If
If [OPS] = 7 Then
[TBC].BackColor = 65535
[TBC].Visible = True
End If
End Sub
The problem what I am having is if you don't have focus
on one of the fields they all have the same color. but
when you show focus on one of the fields, it shows the
color it suppose to. How can I make it show the colors to
were they are not all the same color. when I show focus
on a field, then the rest show the same color. How can I
stop that form happening, and I want them to show
different colors when needed. Is there any way to fix
that?
In the subform I wanted a TextBox to change colors
depending on a value of another box. This is my code.
Private Sub Form_Current()
If [OPS] = 1 Then
[TBC].Visible = False
End If
If [OPS] = 2 Then
[TBC].BackColor = 13434828
[TBC].Visible = True
End If
If [OPS] = 3 Then
[TBC].BackColor = 9868950
[TBC].Visible = True
End If
If [OPS] = 4 Then
[TBC].BackColor = 52479
[TBC].Visible = True
End If
If [OPS] = 5 Then
[TBC].BackColor = 16751052
[TBC].Visible = True
End If
If [OPS] = 6 Then
[TBC].BackColor = 13421619
[TBC].Visible = True
End If
If [OPS] = 7 Then
[TBC].BackColor = 65535
[TBC].Visible = True
End If
End Sub
The problem what I am having is if you don't have focus
on one of the fields they all have the same color. but
when you show focus on one of the fields, it shows the
color it suppose to. How can I make it show the colors to
were they are not all the same color. when I show focus
on a field, then the rest show the same color. How can I
stop that form happening, and I want them to show
different colors when needed. Is there any way to fix
that?