G
Guest
I have a text box where I want to change the backcolor depending on the name
in the text box. For example, if the text box reads "red", then the backcolor
should turn red.
I came up with this, but it doesn't seem to work. Can anyone help? Thanks.
Option Compare Database
Private Sub lblColor()
Dim lblColor As String
If Me.lblColor = "Red" Then
Me.lblColor.BackColor = vbRed
ElseIf Me.lblColor = "Orange" Then
Me.lblColor.BackColor = vbWhite
End Sub
in the text box. For example, if the text box reads "red", then the backcolor
should turn red.
I came up with this, but it doesn't seem to work. Can anyone help? Thanks.
Option Compare Database
Private Sub lblColor()
Dim lblColor As String
If Me.lblColor = "Red" Then
Me.lblColor.BackColor = vbRed
ElseIf Me.lblColor = "Orange" Then
Me.lblColor.BackColor = vbWhite
End Sub