I have a textbox, [Due Date] on a form. If the date in the field is greater than todays date, I need the text in the field to be bold red. If the date is less than or equal to todays date, then I need the text to remain as it is set in the properties, (bold black).
I've tried the below code with no change to the color:
Private Sub Form_Open(Cancel As Integer)
If Me.[Due Date] > Now() Then
Me.[Due Date].ForeColor = vbRed
Else
Me.[Due Date].ForeColor = vbBlack
End If
End Sub
I've also tried Conditional formatting with the first condition being If the date in the field is greater than todays date, the text in the field is to be bold red.
This didn't work either.
Any help would be greatly appriciated.
M
I've tried the below code with no change to the color:
Private Sub Form_Open(Cancel As Integer)
If Me.[Due Date] > Now() Then
Me.[Due Date].ForeColor = vbRed
Else
Me.[Due Date].ForeColor = vbBlack
End If
End Sub
I've also tried Conditional formatting with the first condition being If the date in the field is greater than todays date, the text in the field is to be bold red.
This didn't work either.
Any help would be greatly appriciated.
M