Results 1 to 6 of 6
  1. #1
    Derrick T. Davidson is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    142

    Conditional Formating

    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??

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    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)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Derrick T. Davidson is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    142
    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

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Your thread title is Conditional Formatting and you need to do this using CF! In Form Design View:

    1. Right-Click on the ClientRef_005 Control
    2. Click on Conditional Formatting
    3. Under Condition1, use the dropdown and select Expression Is
    4. In the next box to the Right enter Nz([ClientRef_005],"")<>""
    5. Do the Formatting you want; the big 'Paint Bucket' is used for setting Back Color
    6. Click on OK


    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Derrick T. Davidson is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    142
    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.

  6. #6
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    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)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Conditional formating in a report
    By msmithtlh in forum Programming
    Replies: 12
    Last Post: 03-20-2013, 02:25 PM
  2. Conditional Formating
    By redbull in forum Reports
    Replies: 2
    Last Post: 03-26-2012, 12:08 PM
  3. Conditional Formating help
    By Mounds in forum Forms
    Replies: 2
    Last Post: 02-10-2012, 11:07 AM
  4. Conditional formating!
    By karanvemuri in forum Access
    Replies: 3
    Last Post: 10-29-2011, 03:34 PM
  5. HELP! Conditional Formating question
    By tobydobo in forum Access
    Replies: 1
    Last Post: 09-09-2011, 04:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums