• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 6. Exploring Reports > Conditional Formatting

Conditional Formatting

Conditional formatting enables you to change the format of a control in a form or report based on the value of the control. If you want to change a control’s color to red when its value exceeds 2,000, you can do that using conditional formatting. In the old days, before the conditional formatting function was added to Access, it was handled through code. You no longer have to be a programmer to take advantage of this feature. The following steps guide you through adding conditional formatting to a report:

While in the Music Store database, open the Inventory Practice report in Design view.

Click the UnitPrice text box.

Click Format, Conditional Formatting from the menu, or right-click and choose Conditional Formatting from the shortcut menu.

Click the box to the right of the between box under Condition 1.

Type 1000 and press Tab. Type 1999 in the box after the word “and.”

Click the B for boldface and watch the text on the large white box below the Condition 1 boxes change to boldface.

Click the Add button next to add the next condition. In the Condition 2 section, click the drop-down box of the between box.

Choose greater than and press Tab. Type 2000.

Click the drop-down box next to the A for alpha button as shown in Figure 6.24.

Figure 6.24. You can use conditional formatting options in a report without programming.

Choose red (the third box down from black). Click OK to set the format.

Click Print Preview to view the report, as shown in Figure 6.25.

Figure 6.25. Use the Print Preview option to check the conditional formatting results.

Click the next record indicator to view subsequent pages while checking the Unit Price text box to confirm the conditional formatting. Close Print Preview as well as the report.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint