I have inherited a Excel workbook which has a listbox populated by a query on a database table. Recently the number of records returned has exceeded 60. The following code is used to red the selected items.
For i = 0 To LBSubjects.ListCount - 1
If LBSubjects.Selected(i) Then
keystr = keystr & LBSubjects.List(i, 0) & ","
End If
Next
Unfortunately this only goes as far as the 60th record and then exits the loop.
The ListCount appears to be a fixed at a maximum of 60 and is readonly property.
Does anyone have a method of reading through all the records?
Many thanks
Sandy
For i = 0 To LBSubjects.ListCount - 1
If LBSubjects.Selected(i) Then
keystr = keystr & LBSubjects.List(i, 0) & ","
End If
Next
Unfortunately this only goes as far as the 60th record and then exits the loop.
The ListCount appears to be a fixed at a maximum of 60 and is readonly property.
Does anyone have a method of reading through all the records?
Many thanks
Sandy