Background color changes based on Output

I use the following code in a report that shows what account must be paid within the next 30 days.

If the due date of the account is within 30 days then the back ground of the text box is shown as Yellow, otherwise it is White.

Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
Dim color_white As Long
Dim color_yellow As Long
color_white = RGB(255, 255, 255)
color_yellow = RGB(255, 255, 0)
If Me!due_date < Date + 30 Then
Me!due_date.BackColor = color_yellow
Else
Me!due_date.BackColor = color_white
End If
End Sub
Hi Poppa Smurf, Thanks for your reply, let me see if I can get this going.
My control source reads as follows =[1st Quarter (Actuals)]/[1st Quarter (Projected)] anf I wanto to get the background change and the word shoul match.

>100% "RED"
=<100 "YELLOW" etc.
 
dorramide7

I have already provided Dgavilanes as solution so please contact. It is a coincidence that two people are working on the same form.

Just a point you can not have the word and background colour the same colour, if you do you will have the text box with a colour and the word will blend in with the background.
 

Users who are viewing this thread

Back
Top Bottom