G
Guest
Hi,
I am trying to color rate fields on status level (ex.HIGH/RED,
Medium/YELLOW and Low/GREEN). I have created code that does that but
when the choice is made the back color is changed for all the records
for that specific field. I want it to specific only for that one field
for that one invoice.
I would appreciate any suggestions, please. Thank you
My Code:
Private Sub Status_AfterUpdate()
Dim Rating As String
Dim Red As Long, Yellow As Long, Green As Long
If Not IsNull(Me!Status) Then
Rating = Me!Status
Else
Exit Sub
End If
Red = RGB(255, 0, 0)
Green = RGB(0, 255, 0)
Yellow = RGB(255, 255, 0)
White = RGB(255, 255, 255)
If Rating = "High" Then
Me!Status.BackColor = Red
ElseIf Rating = "Medium" Then
Me!Status.BackColor = Yellow
ElseIf Rating = "Low" Then
Me!Status.BackColor = Green
Else
Me!Status.BackColor = White
End If
End Sub
I am trying to color rate fields on status level (ex.HIGH/RED,
Medium/YELLOW and Low/GREEN). I have created code that does that but
when the choice is made the back color is changed for all the records
for that specific field. I want it to specific only for that one field
for that one invoice.
I would appreciate any suggestions, please. Thank you
My Code:
Private Sub Status_AfterUpdate()
Dim Rating As String
Dim Red As Long, Yellow As Long, Green As Long
If Not IsNull(Me!Status) Then
Rating = Me!Status
Else
Exit Sub
End If
Red = RGB(255, 0, 0)
Green = RGB(0, 255, 0)
Yellow = RGB(255, 255, 0)
White = RGB(255, 255, 255)
If Rating = "High" Then
Me!Status.BackColor = Red
ElseIf Rating = "Medium" Then
Me!Status.BackColor = Yellow
ElseIf Rating = "Low" Then
Me!Status.BackColor = Green
Else
Me!Status.BackColor = White
End If
End Sub