Hello, I attempted to write a code to change the background color of a textbox when data is entered -
The color starts at yellow and I want it to change to white when someone enters data. The code I used was:
I get a "End If: If not defined" error that points to the "Private Sub" line. What am I doing wrong? Also, I'm sure the Form_Open is not a good place for this code. Where can I place this code so that the textbox automatically changes on edit and goes back to yellow if no data is entered or data is deleted?
The color starts at yellow and I want it to change to white when someone enters data. The code I used was:
Code:
Private Sub Form_Open (Cancel As Integer)
If fldOverallClassification.Value Is Not Null Then fldOverallClassification.BackColor = vbWhite
End If
End Sub
I get a "End If: If not defined" error that points to the "Private Sub" line. What am I doing wrong? Also, I'm sure the Form_Open is not a good place for this code. Where can I place this code so that the textbox automatically changes on edit and goes back to yellow if no data is entered or data is deleted?