I am working with a main form (frmCases) on which I have placed a tab control with a subform (fsubCaseProgress) thereon. The subform displays in datasheet view. One of the fields in the datasheet view is a date field [TargetDate].
What I want to do is have the TargetDate field in this subform datasheet display in red if it is fewer than 14 days from Now(), and black if it is more than 14 days from Now().
I was able to make this work with a date field that is part of the main form as follows:
Private Sub Form_Current()
If Me.NextDueDate.Value >= (Now() + 14) Then
Me.NextDueDate.ForeColor = 0
ElseIf Me.NextDueDate.Value <= (Now() + 14) Then
Me.NextDueDate.ForeColor = 255
End If
End Sub
I can’t seem to make this work in the subform. I have searched the forum to see if this has already been addressed, but didn’t find (or didn’t recognize?) the answer. I would very much appreciate any help that someone might offer—I’m only a techie wannabe
and not the real thing
…… Thanks in advance.
What I want to do is have the TargetDate field in this subform datasheet display in red if it is fewer than 14 days from Now(), and black if it is more than 14 days from Now().
I was able to make this work with a date field that is part of the main form as follows:
Private Sub Form_Current()
If Me.NextDueDate.Value >= (Now() + 14) Then
Me.NextDueDate.ForeColor = 0
ElseIf Me.NextDueDate.Value <= (Now() + 14) Then
Me.NextDueDate.ForeColor = 255
End If
End Sub
I can’t seem to make this work in the subform. I have searched the forum to see if this has already been addressed, but didn’t find (or didn’t recognize?) the answer. I would very much appreciate any help that someone might offer—I’m only a techie wannabe
![[ponder] [ponder] [ponder]](/data/assets/smilies/ponder.gif)
![[smarty] [smarty] [smarty]](/data/assets/smilies/smarty.gif)