A
Amit
MS Access 2K, Windows XP
========================
Hi,
In my form, I'd like to change the color of the textbox
control based on a condition. I have the following code in
the "On Current" event of the form:
=====================================================
Private Sub Form_Current()
'change the color of the person to Red if Inactive
Dim lngRed As Long, lngBlack As Long
lngRed = RGB(255, 0, 0)
lngBlack = RGB(0, 0, 0)
If Me.StaffStatus = "Inactive" Then
Me!PersonName.ForeColor = lngRed
Else
Me!PersonName.ForeColor = lngBlack
End If
End Sub
=======================================================
This code works (turns the text to Red where applicable)
when I view the form in the "Form view", but doesn't work
when I view it in "Datasheet view".
Is there any way to make this work?
Thanks!
-Amit
========================
Hi,
In my form, I'd like to change the color of the textbox
control based on a condition. I have the following code in
the "On Current" event of the form:
=====================================================
Private Sub Form_Current()
'change the color of the person to Red if Inactive
Dim lngRed As Long, lngBlack As Long
lngRed = RGB(255, 0, 0)
lngBlack = RGB(0, 0, 0)
If Me.StaffStatus = "Inactive" Then
Me!PersonName.ForeColor = lngRed
Else
Me!PersonName.ForeColor = lngBlack
End If
End Sub
=======================================================
This code works (turns the text to Red where applicable)
when I view the form in the "Form view", but doesn't work
when I view it in "Datasheet view".
Is there any way to make this work?
Thanks!
-Amit