How to check all check boxes in a repeating table in InfoPath 2010

Applies to: InfoPath 2010

Learn how you can use rules on a Select All check box to check all check boxes in a repeating table in InfoPath 2010.

ADVERTISEMENTS

Problem

You have a check box in a repeating table and want to be able to select all of the check boxes in each row of the repeating table.

Solution

You can use a "Select All" check box and rules to toggle the selection of all check boxes in a repeating table either on or off.

Discussion

In How to create a toggle button in InfoPath using rules and conditions I showed you how you can use a button in InfoPath 2007 to toggle check boxes in a repeating table on and off.

While the names and locations of functionality may differ between InfoPath 2007 and InfoPath 2010, you can still apply the same technique in InfoPath 2010. Here we will use a check box instead of a button to check or uncheck all check boxes in a repeating table in InfoPath 2010.

You can achieve this functionality as follows:

  1. In InfoPath 2010, create a new Blank Form template.
  2. Add a Repeating Table control with one column to the form template.
  3. Right-click the text box within the repeating table and select Change Control > Check Box from the context menu that appears.
  4. Right-click the check box within the repeating table and select Check Box Properties from the context menu that appears.
  5. On the Check Box Properties dialog box, change the Name to checkboxinrepeatingtable, select True/False (Boolean) from the Data type drop-down list box, and click OK.
  6. Click in the header of the repeating table to place the cursor, and then add a Check Box control to the header, name it checkallcheckboxes, left-align it, and type the text Select All behind it.

    Select All check box to check all check boxes in a repeating table in InfoPath

    Figure 1. Select All check box to check all check boxes in a repeating table in InfoPath.
  7. Add an Action rule to the "Select All" check box, with the Condition:

    checkallcheckboxes = TRUE
    and the action:

    Set a field's value: checkboxinrepeatingtable = "true"
    and select the Don't run remaining rules if the condition of this rule is met check box.
  8. Add a second Action rule to the "Select All" check box, with the Condition:

    checkallcheckboxes = FALSE
    and the action:

    Set a field's value: checkboxinrepeatingtable = "false"
    and select the Don't run remaining rules if the condition of this rule is met check box.
  9. Preview the form.

When the form opens, add a few rows to the repeating table and then select the "Select All" check box. All of the check boxes in the repeating table should now be selected. Then deselect the "Select All" check box. All of the check boxes in the repeating table should now be deselected.

 


Related InfoPath Articles:

 

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.

InfoPath 2013 Cookbook: 121 Codeless Recipes for Beginners

InfoPath 2013 Cookbook 2: 121 Codeless Recipes for SharePoint 2013

InfoPath 2010 Cookbook: 101 Codeless Recipes for Beginners

InfoPath 2010 Cookbook 2: 101 Codeless Recipes for SharePoint 2010

InfoPath 2010 Cookbook 3: 101 Code Recipes for C# Developers

InfoPath 2010 Cookbook 4: 101 Code Recipes for VB Developers

InfoPath 2010 Cookbook 5: Integrating InfoPath with Excel and Excel Services