Presenting Subform Aggregates in the Master Form

When creating a subform, you may want to display subform aggregate information in the master form. For example, you may want to display the count of the records in the subform somewhere on your main form. (For an example of this technique, see the "Subform 1" form in AC208.MDB.)

To put such an aggregate in the master form, you must first put it in the subform! Displaying aggregate information in the subform itself is straightforward. Place a text box wherever you want in the subform and put an aggregate expression, such as " = Count([Product Id])", into its ControlSource property. Either put the text box in the form's header or footer (if you don't intend to display the header or footer), or make it hidden.

In the master form, insert a new text box with ControlSource:

= Subform1.Form![Aggregate Control]

This control will update every time you change its value in the subform.