I
Ivor Williams
I've a form on which there is a check box TaskComp and a text box TaskDate.
Using the following VBA code, when the check box is checked, the Date in the
text box is set to the current date. This works fine.
Private Sub TaskComp_AfterUpdate()
If TaskComp.Value = -1 Then TaskDate.Value = Date Else TaskDate.Value =
Null
End Sub
I want the background color of the text box to change from whit to red when
the check box is echecked, so I added to the code:
Private Sub TaskComp_AfterUpdate()
If TaskComp.Value = -1 Then TaskDate.Value = Date Else TaskDate.Value =
Null
If TaskComp.Value = -1 Then TaskDate.BackColor = 255 Else
TaskDate.BackColor = 16777215
End Sub
The date is updated as expected, but the text box background color is
changed in the text box for every record, not just the current one. Is there
a "work around" I can use to get what I'm after?
Ivor
Using the following VBA code, when the check box is checked, the Date in the
text box is set to the current date. This works fine.
Private Sub TaskComp_AfterUpdate()
If TaskComp.Value = -1 Then TaskDate.Value = Date Else TaskDate.Value =
Null
End Sub
I want the background color of the text box to change from whit to red when
the check box is echecked, so I added to the code:
Private Sub TaskComp_AfterUpdate()
If TaskComp.Value = -1 Then TaskDate.Value = Date Else TaskDate.Value =
Null
If TaskComp.Value = -1 Then TaskDate.BackColor = 255 Else
TaskDate.BackColor = 16777215
End Sub
The date is updated as expected, but the text box background color is
changed in the text box for every record, not just the current one. Is there
a "work around" I can use to get what I'm after?
Ivor