Code:
Private Sub FILL_LISTVIEW()
RSTADO.MoveFirst
Erase STRDBROWS()
STRDBROWS = RSTADO.GetRows(RSTADO.RecordCount)
RSTADO.Close
Set RSTADO = Nothing
With Me.ListView1
SendMessage Me.hwnd, WM_SETREDRAW, SR_OFF, 0&
.ListItems.Clear
For I = 0 To UBound(STRDBROWS, 2)
DoEvents
Set ITMX = .ListItems.Add(, , UCase(STRDBROWS(0, I)))
For L = 1 To 61
ITMX.SubItems(L) = Replace(UCase(STRDBROWS(L, I)), "AAAAAAAAAAAAAAAAA", Chr(34) & UCase(BB) & Chr(34))
DoEvents
Next L
'DoEvents
Next I
.Refresh
SendMessage Me.hwnd, WM_SETREDRAW, SR_ON, 0&
'Me.LNR1.Caption = ""
End With
If Not RSTADO Is Nothing Then
If (RSTADO.State And adStateOpen) = adStateOpen Then
RSTADO.Close
End If
Set RSTADO = Nothing
End If
End Sub
possible to optimize the fill listview, the code is very, very slow!
note:
Records are approx 65.xxx