The immediate container of an object.

Property of

Most data, form, and report objects

Description

Many objects are related in a containership hierarchy. If the container object— referred to as the parent—is destroyed, all the objects it contains—referred to as child objects—are also destroyed. Child objects may be parents themselves and contain other objects. Destroying the highest-level parent destroys all the descendant child objects.

An object’s parent property refers to its parent object.

For example, a form contains both data objects and visual components. A Query object in a form has the form as its parent. The Query object contains a rowset, which contains an array of fields, which in turn contains Field objects. Each object in the hierarchy has a parent property that refers back up the chain, up to the form, which has no parent. A button on the form also has a parent property that refers to the form. If the form is destroyed, all of the objects it contains are destroyed.

The parent property is often used to refer to sibling objects—other objects that are contained by the parent. For example, one Field object can refer to another by using the parent reference to go one level up in the hierarchy, then use the name of the other field to go back down one level to the sibling object.

The parent property is read-only.