I need help. I will try to explain this the best way I can. I have a form, on this form I got many text boxes. I would like to change the color of the information inside a text box (TargetResolutionDate) to red if the date in that box is past todays date. But I only want that to happen if what is in a combo box (StatusID) is = to Open. In other words, make the target resolution date red if the issue is open and past due.
Here is what I had started and I was trying to fumble through it but it seems to stay red if it is past due even of I comment out all this code.
Private Sub Form_Open(Cancel As Integer)
If Me!StatusID = 1 Then 'Check textbox for Resolution date
If TargetResolutionDate < Now() Then
frm_Main_Issues!TargetResolutionDate.ForeColor = 255
ElseIf TargetResolutionDate > Now() Then
frm_Main_Issues!TargetResolutionDate.ForeColor = 0
End If
End If
End Sub
Here is what I had started and I was trying to fumble through it but it seems to stay red if it is past due even of I comment out all this code.
Private Sub Form_Open(Cancel As Integer)
If Me!StatusID = 1 Then 'Check textbox for Resolution date
If TargetResolutionDate < Now() Then
frm_Main_Issues!TargetResolutionDate.ForeColor = 255
ElseIf TargetResolutionDate > Now() Then
frm_Main_Issues!TargetResolutionDate.ForeColor = 0
End If
End If
End Sub