You can't have a decimal in front of the number.
I converted the numbers you gave from Hex to Decimal and the code works.
#EB15C should be #0EB15C (three groups of 2)
#0EB15C = RGB(12, 177, 92) = 12632256
#C0C0C0 = RGB(192, 192, 192) = 6074536
This is the code I used to check the colors
Code:
Private Sub Check13_Click()
Dim Color1 As Long
Dim Color2 As Long
Color1 = RGB(12, 177, 92)
Color2 = RGB(192, 192, 192)
If Me.Check13 Then
Me.Case_name_Label.ForeColor = Color1
Else
Me.Case_name_Label.ForeColor = Color2
End If
End Sub
You can use:
Me.Case_name_Label.ForeColor = Color1 (Color1 set in code)
or
Me.Case_name_Label.ForeColor = RGB(12, 177, 92)
or
Me.Case_name_Label.ForeColor = 12632256
If you want colors 88888 and 22222, don't use the decimals in front or behind the numbers
Code:
Private Sub Check13_Click()
If Me.Check13 Then
Me.Case_name_Label.ForeColor = 88888
Else
Me.Case_name_Label.ForeColor = 22222
End If
End Sub