I have a listview that is being populated with about 6000 items...
This takes a few seconds. I found a way to make it faster. I want to add only the first visible items to the listview and add blank items for the rest. As I scroll the listview, I want to be able to add the details for the blank items.Code:Dim recItems As Recordset Dim intCount As Integer Dim intItem As Integer Dim lstItem As ListItem Dim lstColumn As ColumnHeaders Dim intColumn As Integer With dbsData Set recItems = .QueryDefs("Debtor Count").OpenRecordset intCount = recItems!Count set recItems = .QueryDefs("Debtor List").OpenRecordset End With For intItem = 1 To intCount 'Adds the item to the list Set lstItem = frmForm.vewitems.ListItems.Add() With lstItem .SmallIcon = CInt(recItems!Image) .Icon = CInt(recItems!Image) - 2 .Key = recItems!Id .Text = recItems!Name 'Adds the subitems Set lstColumn = frmForm.vewitems.ColumnHeaders For intColumn = 2 To lstColumn.Count .SubItems(intColumn - 1) = "" & _ recItems.Fields (lstColumn(intColumn).Key) Next .Ghosted = recItems!Deleted End With recItems.MoveNext 'Next record Next
The problem is, there is no scroll event for the listview. Does anyone know how to execute code when someone scrolls the listview?




Reply With Quote