Posted by Chris Downs, writer, Access IW Content Team Here’s a great tip suggested by Clint Covington. Using an expression and a Rich Text text box, you can create a traffic light indicator in an Access form or report, as in the following illustrations: First, add a text box to the form or report,
Office 2010 Generator Key, and set the following properties: Property Setting Text Format Rich Text Locked True Enabled False Then, enter the following expression into the Control Source property: ="<font face=Webdings size=1 color=" & IIf([Status]="Active",
Office Professional Plus 2010 32bit,"#ED1C24", IIf([Status]="Resolved","#FFF20C", IIf([Status]="Closed","#22B14C"))) & ">n </font>" Edit the items in bold text so that they refer to field names and values in your database. This expression creates an HTML string that the Rich Text text box can interpret. In short, it specifies the letter “n”, which in the Webdings font corresponds to the circular icon. The IIf functions set the icon’s color to red,
Microsoft Office 2010 Home And Business produit cl��, yellow, or green,
Microsoft Office 2010 Professional Plus Key, respectively. You can nest more IIf statements together to accommodate more values—check out this color reference to obtain the Hex values of more varied colors. Note: Instead of entering the expression in the Control Source property of the text box, you can also create a calculated field in a query, and then bind the text box to that field. For example, in the Field row of the query design grid, enter: StatusLight: "<font face=Webdings size=1 color=" & IIf([Status]="Active","#ED1C24",
Microsoft Office Standard 2010 Key, IIf([Status]="Resolved","#FFF20C", IIf([Status]="Closed","#22B14C"))) & ">n </font>" And then bind the Rich Text text box to the StatusLight field. <div