Understanding Subforms

A subform is a control designed for use on a power form or another subform. Although technically a control, subforms have some form characteristics as well. Each subform represents one data view; that is, each subform control can have a single business view (BV) attached to it. Power forms can contain several subforms, so a single power form with multiple subforms enables users to see multiple data views. For example, a user selecting a purchase order in a grid could see related shipping information in one subform and fulfillment information in another subform on the same power form. When the user selects a row in the grid, all of the data is updated and, most importantly, the user does not have to open a new form to see the updated data.

Together, power forms and subforms provide developers with the ability to code:

  • Multiple views on a form.

  • Multiple grids on a form.

  • Multiple tab controls on a form.

  • Tab pages with their own business view.

  • BVs that can communicate with each other, and even react to selection and data changes that occur in other views on the form.

Subforms have two main characteristics:

  • To its parent, it is a control.

  • To the controls that it contains, it is a form.

When you place subforms on a power form or subform, the system treats the interactions among them as parent/child relationships, with the power form or subform as the parent and the subforms as the children of the power form and siblings to each other. This hierarchical relationship governs logical relationships. It is also represented visually in the Form Design Aid (FDA) Application Tree View as a hierarchy to help you understand the relationships.

Similarly to a form, a subform owns the data flows between the interface view and the database, including browse, insert, update, or delete. In fact, you create a subform as if it were a form, and then place it as a control. Do not let its appearance fool you, however. A subform is really a control and the FDA interface treats it accordingly. For example, if subform B is contained in power form A, when you select B, the FDA control bar still displays the title of A. Additionally, if you view the data structure, you will see the data structure for A and not for B.