PDA

View Full Version : Solved: Change font Color



hatched850
05-26-2005, 02:20 PM
I have been trying to get Access to do this for a couple of days now :banghead: . I have a due date in a tracking system I am doing. I need the due date to be Red if it is with in 5 days of today in a form. Can someone please help me???:(

Thanks Debbie

xCav8r
05-26-2005, 04:51 PM
Private Sub Form_Current()
If Not IsNull(Me.dateDueDate) Then
Select Case LessThanFiveDaysOut(Me.dateDueDate)
Case True
Me.dateDueDate.ForeColor = 255
Case Else
Me.dateDueDate.ForeColor = 0
End Select
End If
End Sub

Function LessThanFiveDaysOut(dateDateToEvaluate As Date) As Boolean
If DateDiff("d", Now, dateDateToEvaluate) <= 5 Then
LessThanFiveDaysOut = True
Else
LessThanFiveDaysOut = False
End If
End Function

hatched850
05-27-2005, 06:46 AM
You are GREAT!!! It worked beautifully!! Thank you so much you are a lifesaver.

xCav8r
05-27-2005, 07:41 AM
:beerchug: