SubdatasheetHeight Property

Microsoft Access Visual Basic

SubdatasheetHeight Property

       

You can use the SubdatasheetHeight property to specify or determine the display height of a subdatasheet when expanded. Read/write Integer.

expression.SubdatasheetHeight

expression   Required. An expression that returns one of the objects in the Applies To list.

Remarks

The SubdatasheetHeight property applies only to tables and queries within a Microsoft Access database (.mdb).

The SubdatasheetHeight property in a numeric expression representing the default height to display in the subdatasheet.

The easiest way to set the SubdatasheetHeight property is by using a table's property sheet. You can set this property by using Visual Basic. In Visual Basic, the property's value is expressed in twips.

To set the SubdatasheetHeight property by using Visual Basic, you must first either:

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