I have a report and I want the backcolor to change based on the value in a field named color. Here is the code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Select Case Me.Color
Case Purple
Me.Detail.BackColor = RGB(204, 204, 255)
Case "Green"
Me.Detail.BackColor = RGB(204, 236, 255)
Case Yellow
Me.Detail.BackColor = RGB(255, 255, 204)
Case Blue
Me.Detail.BackColor = RGB(204, 236, 255)
Case Orange
Me.Detail.BackColor = RGB(255, 204, 153)
Case Grey
Me.Detail.BackColor = RGB(221, 221, 221)
Case Else
Me.Detail.BackColor = vbRed
End Select
End Sub
This has no effect. However I was able to change the background color of a box set behind the other fields with this code. The problem was that it set all fields to the value from the last box.
Any help is greatly appreciated