Hello Guys,
I always have some issues with my date functions. I am trying to get a field to turn red if the date is within 2019 but it is not working. what am I doing wrong? and what if I want it to turn blue if we are in the current year?
Here is my code
Thank you,
I always have some issues with my date functions. I am trying to get a field to turn red if the date is within 2019 but it is not working. what am I doing wrong? and what if I want it to turn blue if we are in the current year?
Here is my code
Code:
Private Sub Detail_Click()
Dim curYear As Date
Dim lastYear As Date
curYear = DatePart("yyyy", Me.Expires)
If DateTime.DateAdd("yyyy", -1, curYear) Then
Me.Expires.ForeColor = vbRed
End If
End Sub