Quick Tip: How to create a dynamic label in InfoPath

Filed under: InfoPath 2007

Learn how to use a text box or an expression box control together with rules and filters to create a dynamic label in InfoPath.

ADVERTISEMENTS

A label can be defined as a “piece of read-only text” that describes something. A dynamic label can be defined as a “piece of read-only text that can be changed dynamically at run-time”.

There are 3 ways to create a label in InfoPath:

  1. Type text directly on a View of an InfoPath form template.
  2. Use a Text Box control and display it as Read-only.
  3. Use an Expression Box control.

Only the second and third methods will allow you to use Rules to dynamically change the text of the control and thus create a dynamic label in InfoPath.

To use a Text Box to create a dynamic label:

  1. Add a Text Box control to your InfoPath form template.
  2. Double-click the text box control to open its Properties dialog box.
  3. On the Text Box Properties dialog box, click the Display tab, select the Read-only check box, and click OK.
  4. Use rules and filters to change the text in the field that represents the Text Box on the InfoPath form template.

To use an Expression Box to create a dynamic label:

  1. Add a Text Box control to your InfoPath form template.
  2. Right-click the text box control, select Change To, and then Expression Box from the drop-down menu that appears.
  3. Use rules and filters to change the text in the field that represents the Expression Box on the InfoPath form template.
 


Related Posts

 

Copyright: This article may not be used on web sites (whether personal or otherwise), copied, disseminated, altered, printed, published, broadcasted, or reproduced in any way without an expressed written consent. The techniques demonstrated in this article may be used within any Microsoft InfoPath project. This article is provided without any warranties. Copyright for this article is non-transferrable and remains with the author.