Apply or change conditional formatting on a control

Microsoft Office Access 2003

Show All Show All

Apply or change conditional formatting on a control

  1. Open the form in Design view or Form view, or the report in Design view.

    Note  You cannot apply conditional formatting to a control on a data access page.

  2. Do one of the following:
    • If you are in Design view, click the control for which you want to apply conditional formatting.
    • If you are in Form view, make sure the control has focus.
  3. On the Format menu, click Conditional Formatting.
  4. Do one or more of the following:

    Show Change the format of a control when it meets certain criteria

    1. Do one of the following:

      To use values in the selected control as the formatting criteria, click Field Value Is in the first box, click the comparison phrase in the second box, and then type a value in the third (and fourth) box. You can enter a constant value or an expression.

      To use an expression as the formatting criteria (to evaluate data or a condition other than the values in selected controls), click Expression Is in the first box, and then enter the expression in the second box. The expression must return a logical value of TRUE or FALSE.

    2. Select the font style, color, or other formatting that you want to apply. Microsoft Access applies the selected formatting only if the control value meets the condition, or the expression returns a value of TRUE.
    3. To add another condition, click Add, and then repeat steps 1 and 2.

    Show Change the color of the control that has focus

    1. In the Condition x area of the Conditional Formatting dialog box, click Field Has Focus in the first box.
    2. Select the font style, color, or other formatting that you want the field to have when it has focus.

    Show Change, add, or remove a condition

    • To change an existing condition, select the font style, color, or other formatting that you want to apply.
    • To add a new condition, click Add.
    • To remove one or more conditions, click Delete, and then select the check box for the condition or conditions you want to delete.
  5. Click OK.

Notes

  • When you open the Conditional Formatting dialog box, it displays the current default formatting for the selected control, including colors, font styles, and any expressions that you may have defined for the field.

  • You can specify up to three conditions for each control.

  • Conditional formatting is not preserved when you output or export a form or a report to another file format.

  • If none of the specified conditions are true, the control keeps its existing formatting. If more than one specified condition is true, Access applies only the formatting of the first true condition.