0
votes

Is there way to use conditional formatting (similar to excel) to a text box in an ms access form? The user will enter a number in the text box. If the number is between 0-25 is red, if its from 26-50 its yellow, if its from 51-75 than green and 76-100 blue.

How can this be done in MS Access? ?

1
With the form in Design View, right-click the text box and choose Conditional Formatting. Make Condition 1 Field Value Is between 0 and 25, and choose red from the Font/Fore Color dropdown. Click the "Add >>" button to add another condition (Condition 2) ... between 26 and 50, yellow. Repeat for the remaining conditions.HansUp
Hans, you shoup put that as an answer and let JT accept it. Reduce the 'Unanswered' list. =)Alan Waage

1 Answers

2
votes

Note as @Nexus mentioned below, the FormatConditions collection will only accept 3 conditions. But you were aiming for 4 conditions. Unless you can consolidate those into only 3, you won't be able to use Access' conditional formatting feature for this.

With the form in Design View, right-click the text box and choose "Conditional Formatting ..." from the context menu.

Select "Field Value Is" from the drop-down under Condition 1, "between" in the second drop-down, and enter your start (0) and end (25) range values in the next 2 boxes. Choose red from the Font/Fore Color drop-down.

Click the "Add >>" button to add another condition (Condition 2). Set the values for that condition: 26; 50; and yellow.

Repeat for the remaining conditions.

Here's a screen capture of your first 2 conditions applied to a text box. (I chose light grey for the background color so the foreground colors would be more distinct in format preview area.)

enter image description here