Hello!
I have continuous forms that I want to change the color of a text box. However, I don't know where to put the code.
I have tried several places but all the textboxes show up the same color on every form. I want them to be different colors depending on the date.
This is my code. Does anyone know where I need to put it to get the desired result
If (DateDiff("y", Me!DateDue.Value, Now()) > 0) Then
Me!DateDue.ForeColor = 32768 'Green
ElseIf (DateDiff("y", Me!DateDue.Value, Now()) < 0) Then
Me!DateDue.ForeColor = 32768 '255 'Red
ElseIf (DateDiff("y", Me!DateDue.Value, Now()) = 0) Then
Me!DateDue.ForeColor = 16711680 'Blue
End If
Thanks for any help you can give,
Aaron
I have continuous forms that I want to change the color of a text box. However, I don't know where to put the code.
I have tried several places but all the textboxes show up the same color on every form. I want them to be different colors depending on the date.
This is my code. Does anyone know where I need to put it to get the desired result
If (DateDiff("y", Me!DateDue.Value, Now()) > 0) Then
Me!DateDue.ForeColor = 32768 'Green
ElseIf (DateDiff("y", Me!DateDue.Value, Now()) < 0) Then
Me!DateDue.ForeColor = 32768 '255 'Red
ElseIf (DateDiff("y", Me!DateDue.Value, Now()) = 0) Then
Me!DateDue.ForeColor = 16711680 'Blue
End If
Thanks for any help you can give,
Aaron