I am using the following code in the Detail section for the “On Print” event of a report. I would like to be able to print the backcolor of a field in different colors dependent on the field value. It’s not working….what am I doing wrong?
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim lngWhite As Long
Dim lngYellow As Long
Dim lngPink As Long
Dim lngRed As Long
Dim lngGreen As Long
Dim lngBlue As Long
Dim lngLtGreen As Long
lngWhite = RGB(255, 255, 255)
lngYellow = RGB(255, 255, 128)
lngPink = RGB(255, 164, 209)
lngRed = RGB(255, 0, 0)
lngGreen = RGB(0, 128, 64)
lngLtGreen = RGB(179, 255, 217)
lngBlue = RGB(0, 128, 192)
If Me.DocStatus = Draft Then
Me.DocStatus.BackColor = lngYellow
ElseIf Me.DocStatus = “Out For Review” Then
Me.DocStatus.BackColor = lngPink
ElseIf Me.DocStatus = Obsolete Then
Me.DocStatus.BackColor = lngRed
ElseIf Me.DocStatus = Issued Then
Me.DocStatus.BackColor = lngGreen
ElseIf Me.DocStatus = “In For Format” Then
Me.DocStatus.BackColor = lngLtGreen
ElseIf Me.DocStatus = “Issued w/ALAC Approval” Then
Me.DocStatus.BackColor = lngBlue
End If
End Sub