Share this Page URL

Chapter 8. Adding Features and Function ... > Highlighting Data with Conditional F... - Pg. 276

Adding Features and Function to Forms 276 HelloWorld database, we could use conditional formatting to highlight expenses greater than $500 --those that require approval. For campaign tasks, we could highlight any whose due date occurs within the next week or any whose priority is High, which is the example we'll show in this section. You can apply conditional formatting on the basis of a field's value, an expression, or when a field's control has the focus on a form. Here are the steps you follow to set up conditional formatting. Creating expressions for conditional formatting When you select Expression Is in the Conditional Formatting dialog box, you can't open the Expression Builder to help you create an expression. You can, however, use And and Or criteria in an expression to define con- ditions. For example, in the Tasks form, let's say we wanted to highlight the TaskName field when the Priority field is set to High and the task's due date is within one week of today. Here's the expression you could use: [Priority] = 1 And [DueDate]<Date( )+7 Apply conditional formatting 1. 2. With the HelloWorld8 database open, select the Tasks form in the Database window, and then click Design. Right-click the combo box for Priority, and then click Conditional Formatting. (The Conditional Formatting command also appears on the Format menu.) You'll see the Conditional Format- ting dialog box, shown here: