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.
Select a subform set object.
In the Object palette, click the Subform Set tab and ensure
that Select One Subform from Alternatives is selected in the Type
list.
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.
In the Data Connection list, specify the data source you
want to bind data from.
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.
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.
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.
Select a scripting language from the Language list.
In the Expression field, enter your script to perform the
required actions or processing for the specified subform object
and data node.
Repeat steps 6 to 10 for any additional alternative subforms.
Click OK when you finish adding entries to the list.
|
|
|