Add Method (GroupingDefs Collection)

                  Applies To

Creates a new grouping definition. Returns a GroupingDef object.

Syntax

expression.Add(GroupingDefName, GroupingFieldName, PageFieldName, Index)

expression   An expression that returns a GroupingDefs object.

GroupingDefName   Required String. Specifies the name of the new grouping definition.

GroupingFieldName   Required String. Specifies the name of the grouping field used to create the new definition.

PageFieldName   Required String. Specifies the name of the page field used to create the new definition.

Index   Optional Variant. Specifies the ordinal position, the name, or the actual object reference for the grouping definition before which the new grouping definition will be added. If you do not specify this argument, the new grouping definition is added at the end of the collection.

Remarks

A recordset definition that represents a grouping level has an object type of GroupingDef, which is derived from the RecordsetDef object representing the recordset definition. As far as control binding is concerned, a recordset defined by a GroupingDef object behaves just like a recordset defined by a RecordsetDef object.