Form.SubdatasheetHeight property (Access)

Use the SubdatasheetHeight property to specify or determine the default display height of a subdatasheet when expanded. Read/write Integer.

Syntax

expression.SubdatasheetHeight

expression A variable that represents a Form object.

Remarks

the SubdatasheetHeight property's value is expressed in twips.

To set the SubdatasheetHeight property by using Visual Basic, you must first create the property by using the DAO CreateProperty method.

If the subdatasheet includes more records than the height setting can accommodate, a vertical scrollbar is displayed.

The SubdatasheetHeight property setting includes the New Record row if adding new records is supported. It does not include the column header row or scrollbar region.

The SubdatasheetHeight and SubdatasheetExpanded properties take effect on the subform control when the form is in Datasheet view.

Example

The following example resizes the height of the subdatasheet in the Purchase Orders form (containing a subform) to show only one line of the subdatasheet at a time (measured at about 400 twips), accompanied by a vertical scrollbar. The number 400 is arbitrary, and will vary based on monitor resolution and default font size. This behavior can only be seen in Datasheet view.

Forms("Purchase Orders").SubdatasheetHeight = 400

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.