Create data bindings and conditional statements for choice subform sets

After you create a choice subform set, you can create data bindings with or without conditional statements for the various subform objects within the set. Using conditional statements provides better control over when subforms within the choice subform set are displayed on the form than if you specify only a data binding.

For each subform object listed in the Alternative Subforms list in the Edit Data Nominate Subforms dialog box, you can specify a data node from the data connection. If you specify a conditional statement, you can enter an expression that will evaluate to either true or false at run time. Only the first entry in the Alternative Subforms list with a conditional statement that evaluates to true will appear on your form.

Note: If you do not specify a conditional statement for an entry in the Alternative Subforms list, that entry is considered to have a value of true .
  1. Select a subform set object.

  2. In the Object palette, click the Subform Set tab and ensure that Select One Subform from Alternatives is selected in the Type list.

  3. Select Edit Alternatives and choose how you want to specify a subform data binding from within the subform set by performing one of the following actions:

    • Select Choose Subform Whose Name Matches Data Element or Attribute to bind data nodes to subform objects by name. In this case, the names of the associated data nodes must match the names of the subform objects on your form design.

    • Select Choose Subform Using Expression to bind subform objects from your form design to data nodes from the data connection by manually specifying a binding.

  4. In the Data Connection list, specify the data source you want to bind data from.

  5. Click the Add button to insert a new subform into the choice subform set, or select an existing list item. Adding a new subform adds a duplicate of the currently selected subform. If no subform is selected, a new unnamed subform is added to the choice subform set.

  6. In the Name field, type the name for a new subform object, if necessary. If you are binding the subform by data element or attribute name, ensure that the name in the field matches exactly with the name of the associated data node.

    If you selected either Choose Subform Whose Name Matches Data Element or Attribute in step 4, you can go directly to step 11. Otherwise, continue with step 8.

  7. Click the triangle to the right of the Binding field and select a data node from the menu. Designer automatically populates the Binding field with a scripting reference to the data node you select. Alternatively, you can manually type a reference into the field.

  8. Select a scripting language from the Language list.

  9. In the Expression field, enter your script to perform the required actions or processing for the specified subform object and data node.

  10. Repeat steps 6 to 10 for any additional alternative subforms.

  11. Click OK when you finish adding entries to the list.

// Ethnio survey code removed