I have a text box on a form and would like to change the forecolor to black or white (so the text is invisible) based on a variable.
I tried using the conditional formatting feature.
If MyVar = "Y" then do the conditional formatting.
In conditional formatting , I tried
1) Expression is MyVar = "Y" (it interpreted this as "MyVar" = "Y")
2) Expression is '" & MyVar & "' = "Y" (didn't work)
I also tried putting it in the code. On click of a different button, I tried:
1) txtMyTextBoox.ForeColor = RGB(255, 255, 255) (didn't work)
2) txtMyTextBox.ForeColor = vbBlack (didn't work)
Any suggestions?
![]()