ListRows Property

ListRows Property [Access 2003 VBA Language Reference]

Office 2003

You can use the ListRows property to set the maximum number of rows to display in the list box portion of a combo box. Read/write Integer.


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


The ListRows property holds an integer that indicates the maximum number of rows to display. The default setting is 8. The setting for the ListRows property must be from 1 to 255.

You can set this property by using the combo box's property sheet , a macro , or Visual Basic .

For table fields , you can set this property on the Lookup tab of the Field Properties section of table Design view for fields with the DisplayControl property set to Combo Box.


In Visual Basic, use a numeric expression to set the value of this property.

You can set the default for this property by using a combo box's default control style or the DefaultControl property in Visual Basic.

If the actual number of rows exceeds the number specified by the ListRows property setting, a vertical scroll bar appears in the list box portion of the combo box.


The following example uses the ListCount property to find the number of rows in the list box portion of the CustomerList combo box on a Customers form. It then sets the ListRows property to display a specified number of rows in the list.

Public Sub SizeCustomerList()

    Dim ListControl As Control

    Set ListControl = Forms!Customers!CustomerList
    With ListControl
        If .ListCount < 8 Then
            .ListRows = .ListCount
            .ListRows = 8
        End If
    End With
End Sub

Applies to | ComboBox Object

© 2015 Microsoft