Consulting

Results 1 to 4 of 4

Thread: Solved: Change font Color

  1. #1
    VBAX Regular hatched850's Avatar
    Joined
    May 2005
    Location
    Tallahassee, FL
    Posts
    42
    Location

    Question Solved: Change font Color

    I have been trying to get Access to do this for a couple of days now . 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
    Hatched850

  2. #2
    VBAX Expert xCav8r's Avatar
    Joined
    May 2005
    Location
    Minneapolis, MN, USA
    Posts
    912
    Location
    [VBA] 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
    [/VBA]

  3. #3
    VBAX Regular hatched850's Avatar
    Joined
    May 2005
    Location
    Tallahassee, FL
    Posts
    42
    Location
    You are GREAT!!! It worked beautifully!! Thank you so much you are a lifesaver.
    Hatched850

  4. #4
    VBAX Expert xCav8r's Avatar
    Joined
    May 2005
    Location
    Minneapolis, MN, USA
    Posts
    912
    Location

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •