Sandra Smith
asked on
Change lable and text control based on value
I have a user request that if the due date is less than Today plus 7 days, they want the lable and text control to appear on the report as red. I tried the below in the group format, but it turns all lables and due date text controls to red. This is an Access 2003 report.
Private Sub GroupHeader2_Format(Cancel As Integer, FormatCount As Integer)
'If Due date is with 7 or less days, make the box and data red
If Me.TaskDueDate <= (Date + 7) Then
Me.lblTaskDueDate.BorderColor = RGB(239, 5, 29)
Me.lblTaskDueDate.ForeColor = RGB(239, 5, 29)
Me.lblTaskDueDate.FontBold = True
Me.TaskDueDate.BorderColor = RGB(239, 5, 29)
Me.TaskDueDate.ForeColor = RGB(239, 5, 29)
Me.TaskDueDate.FontBold = True
End If
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Not sure if you can conditionally format a label. If you cant, you can always use a borderless texbox instead of a label on your report and get the same effect.
ASKER
Actually, I just asked that very question as I have two conditions that need to be met.