I have similar code (which works prefectly) to change the color of a label when its based on whether a check box is ticked or not:
If its checked, it turns the label yellow (2 labels yellow, in this case), and when I uncheck it, it goes back to its original color:
But when I attempt to do something similar but with a textbox instead of a checkbox, it doesn't quite fully work (it does change the label to yellow when there is text present... but, when I delete the textbox and make it empty, it still stays yellow and it doesn't go back to the original color...(?)
with text:
with no text: (the label remains yellow):
current code: (which is not working... it wont change the label (lblProblem1) back to gray when the textbox is blank... thanks for any help anyone can offer.
If its checked, it turns the label yellow (2 labels yellow, in this case), and when I uncheck it, it goes back to its original color:
VBA Code:
Private Sub chkCSR10J_Click() ' PRODUCTS ARE WRONG or OFF COLOR
If chkCSR10J = True Then Me.lblCSR10J2.BackColor = &HFFFF&
If chkCSR10J = False Then Me.lblCSR10J2.BackColor = &HFFFFC0
If chkCSR10J = True Then Me.chk23W.value = True
If chkCSR10J = False And chkCSR9I = False And chkCSR11K = False And chkCSR12L = False And chkCSR13M = False Then Me.chk23W.value = False
End Sub
But when I attempt to do something similar but with a textbox instead of a checkbox, it doesn't quite fully work (it does change the label to yellow when there is text present... but, when I delete the textbox and make it empty, it still stays yellow and it doesn't go back to the original color...(?)
with text:
with no text: (the label remains yellow):
current code: (which is not working... it wont change the label (lblProblem1) back to gray when the textbox is blank... thanks for any help anyone can offer.
VBA Code:
Private Sub txtProblem1_Change()
If txtProblem1.value = Null Then lblProblem1.BackColor = &HE0E0E0 ' GRAY
If txtProblem1.value <> "" Then lblProblem1.BackColor = &HFFFF& ' YELLOW
End Sub