Hi. I'm trying the following function to change the background color of a textbox if the date difference between today and expire date is less than 120 days.
The form is a continuous form and a textbox to show expiration date is called Expires.
Private Sub Form_Current()
Dim vDiff As Long
vDiff = DateDiff("d", Now, Expires)
If (vDiff < 120) Then
Me.Expires.BackColor = vbYellow
Else
End If
End Sub
However this function changes all the Expires textboxes' background to yellow in my continuous form.
Can anyone give me a suggestion?
Thanks in advance!
The form is a continuous form and a textbox to show expiration date is called Expires.
Private Sub Form_Current()
Dim vDiff As Long
vDiff = DateDiff("d", Now, Expires)
If (vDiff < 120) Then
Me.Expires.BackColor = vbYellow
Else
End If
End Sub
However this function changes all the Expires textboxes' background to yellow in my continuous form.
Can anyone give me a suggestion?
Thanks in advance!