Argument | Description |
control | A Control object that represents a combo box or list box. |
rowindex | The row in the combo box or list box containing the data you want to return. Rows in combo and list boxes are indexed starting with zero. For example, to return the item in the sixth row of a combo box, you'd specify 5 for the rowindex argument. |
Sub RowsSelected()
Dim ctlList As Control, varItem As Variant
' Return Control object variable pointing to list box.
Set ctlList = Forms!Employees!EmployeeList
' Enumerate through selected items.
For Each varItem in ctlList.ItemsSelected
' Print value of bound column.
Debug.Print ctlList.ItemData(varItem)
Next varItem
End Sub