Is there a way to universally change all the text boxes back color so when the text box is completed it grays out, I have a mixture of values and text, I tried =[dirty] in the formating expression but that didn't work??
Is there a way to universally change all the text boxes back color so when the text box is completed it grays out, I have a mixture of values and text, I tried =[dirty] in the formating expression but that didn't work??
Don't know of any way to do this for all Controls in one fell swoop, since you have to actually name the Control, but this should do what you need:
Expression Is Nz([TargetField],"")<>""
Linq ;0)>
I put this in the On Dirty of the control, but all I get is syntax error:
Private Sub ClientRef_005_Dirty(Cancel As Integer)
Nz([ClientRef_005],"")<>""
Linq ;0)>
End Sub
Your thread title is Conditional Formatting and you need to do this using CF! In Form Design View:
- Right-Click on the ClientRef_005 Control
- Click on Conditional Formatting
- Under Condition1, use the dropdown and select Expression Is
- In the next box to the Right enter Nz([ClientRef_005],"")<>""
- Do the Formatting you want; the big 'Paint Bucket' is used for setting Back Color
- Click on OK
Linq ;0)>
Thank you very much as you said initially I have to do every control individually, but it works well now. I assume Linq ;0)> has nothing to do with the code? Great job making the instructions VERY simple, again thank you.
No, my nickname preceded Language Integrated Query by about 40 years!
Some things like this can be done for all Controls at once, like changing the Back Color when the Control has Focus (one option is simply Field Has Focus and requires no identification of the Field's name) but if an Expression has to be used, like here, you're out of luck. Maybe someone out there has a better idea, but I've never come across it, and being in forced retirement, I've spent about 6-8 hours a day, for seven years now, and this and four or five other Access forums.
Glad we could help, and good luck on your project!
Linq ;0)>