Share this Page URL

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

Adding Features and Function to Forms 5. 277 6. 7. In the text box, enter 1. We need to enter 1 rather than High because the Priority combo box is bound to the Expen- seTypeID field. Access won't recognize the term High as a value for that field, although it displays that value in the control. The fact that you see one value when a different value is stored is one drawback to using a lookup field. Use the formatting tools below the condition definition area to identify the formatting you want to use when the condition you've defined is met. A sample of the format you apply is displayed for your review. Use the Fill/Back Color button to add a background color to a control. The Font/Fore Color button controls the color of the text displayed in the control. By using the Enabled button, you can specify whether a control can be selected depending on the condi- tions you define. In this example, we've chosen to apply a red background to the control and display the text in boldface, white type. Click OK in the Conditional Formatting dialog box, and then switch the Tasks form to Form view. As you move from one record to the next, when you reach a task whose priority is set to High, you'll see that the field is displayed with the formatting you defined, as shown here: 8. Save your changes to the Tasks form, and then close the form. Just the Steps Apply conditional formatting 1. 2. 3. 4. 5. 6. 7. Open the form you're working with in Design view. Right-click the control you want to apply conditional formatting to, and then click Conditional Formatting. In the Conditional Formatting dialog box, select Field Value Is, Expression Is, or Field Has Focus in the first combo box. If you select Field Value Is, select a comparison operator in the second combo box. Enter the value or expression that will determine when conditional formatting is applied. Use the buttons on the Conditional Formatting toolbar to define the formatting you want to apply. To add a second or third condition, click Add. To delete a condition, click Delete, and then select the condition you want to remove.