• Conditional formatting expressions (XP sp1)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Conditional formatting expressions (XP sp1)

    Author
    Topic
    #394728

    I’ve used conditional formatting a little but have no idea how to achieve the following:

    Colour a text box (any colour will do) based on whether it is empty BUT only if the value of another control in the same record (a check box) is set to true.

    (this is to highlight the users attention that they need to fill something in – the field will only need be filled in for some records, not all)

    The fields in question are on a subform (continuous)

    Is this possible through the use of an expression (ie. changing the condition from ‘field value is’ to ‘expression is’ and referencing the other control)?

    Viewing 1 reply thread
    Author
    Replies
    • #725942

      Say that the text box is named txtSomething and the check box is named chkYesNo. As you wrote, you should select “Expression is” in the dropdown list. Then enter the following expression in the box next to it:

      IsNull([txtSomething]) And [chkYesNo]

      The square brackets around the names are important; if you omit them, Access will assume that you meant a string and put quotes around the names.

      • #726006

        I’m not sure what I was trying but I didn’t have my ‘try the obvious’ head on. That does exactly what I need, cheers.

        • #726026

          >> I didn’t have my ‘try the obvious’ head on.

          Try a different userpic? grin

        • #726027

          >> I didn’t have my ‘try the obvious’ head on.

          Try a different userpic? grin

      • #726007

        I’m not sure what I was trying but I didn’t have my ‘try the obvious’ head on. That does exactly what I need, cheers.

    • #725943

      Say that the text box is named txtSomething and the check box is named chkYesNo. As you wrote, you should select “Expression is” in the dropdown list. Then enter the following expression in the box next to it:

      IsNull([txtSomething]) And [chkYesNo]

      The square brackets around the names are important; if you omit them, Access will assume that you meant a string and put quotes around the names.

    Viewing 1 reply thread
    Reply To: Conditional formatting expressions (XP sp1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: