Z
zmenloans
Hi,
Sorry about my beginner ability, but I have a question. I have a combo box
in a split form, and for each of the 10 values possible to choose in the
combo box (called Color_Codes), I want the ID field to change colors. For
example, if "Paying" is chosen, I want the ID field to turn green.
"Restructure" = purple, "SBA" = pink, "Follow-Up" = gray, and so on. I know
that in Conidtional Formatting, you can do up to three, but I have ten.
I wrote some code below but it only colors the ID field on the form portion,
and I want it to color it on the datasheet portion in the split form as well.
The Conditional Formatting will color both, so I figured there was a way to
edit this code to color both the form and datasheet portion. Or better yet,
I prefer using a Datasheet form rather than a split form if there is a way.
Here is my code thus far (the colors aren't really accurate):
Private Sub Form_Current()
Dim sColor_Codes As Variant 'To account for null values
sColor_Codes = Me.Color_Codes
Select Case sColor_Codes
Case "Paying"
Me.ID.BackColor = RGB(0, 0, 255)
Case "Restructure"
Me.ID.BackColor = RGB(0, 255, 0)
Case "Follow-Up"
Me.ID.BackColor = RGB(255, 0, 0)
Case Else
Me.ID.BackColor = RGB(125, 125, 125)
End Select
End Sub
Thanks a lot!
Sorry about my beginner ability, but I have a question. I have a combo box
in a split form, and for each of the 10 values possible to choose in the
combo box (called Color_Codes), I want the ID field to change colors. For
example, if "Paying" is chosen, I want the ID field to turn green.
"Restructure" = purple, "SBA" = pink, "Follow-Up" = gray, and so on. I know
that in Conidtional Formatting, you can do up to three, but I have ten.
I wrote some code below but it only colors the ID field on the form portion,
and I want it to color it on the datasheet portion in the split form as well.
The Conditional Formatting will color both, so I figured there was a way to
edit this code to color both the form and datasheet portion. Or better yet,
I prefer using a Datasheet form rather than a split form if there is a way.
Here is my code thus far (the colors aren't really accurate):
Private Sub Form_Current()
Dim sColor_Codes As Variant 'To account for null values
sColor_Codes = Me.Color_Codes
Select Case sColor_Codes
Case "Paying"
Me.ID.BackColor = RGB(0, 0, 255)
Case "Restructure"
Me.ID.BackColor = RGB(0, 255, 0)
Case "Follow-Up"
Me.ID.BackColor = RGB(255, 0, 0)
Case Else
Me.ID.BackColor = RGB(125, 125, 125)
End Select
End Sub
Thanks a lot!