Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21340

[RESOLVED] listview wont sort after changing the date

$
0
0
hey

i have a listview with dates
i created anoter form with datepicker and i need to choose the date and its sorts
the listview by the date i pick.
for some reason it dosnt sort nothing just looping each time i pick a date.
Code:

Option Explicit
 Private Const mstrDateFormat As String = "dd-mm-yyyy"
Private Sub DTPicker1_CloseUp()
    Dim lvi As ListItem
    Dim j As Long
    Dim d As Date
   
   
    d = Format$(DTPicker1.Value, mstrDateFormat)
   
 
   
    For j = FrmSecurityreport.LsVw.ListItems.Count To 1 Step -1
        Set lvi = FrmSecurityreport.LsVw.ListItems(j)
        If lvi.SubItems(1) <> d Then
          FrmSecurityreport.LsVw.ListItems.Remove (j)
        End If
 
    Next
 
    Unload Me
 Call FrmSecurityreport.FillList
 
End Sub

what am i missing?
:confused:

Viewing all articles
Browse latest Browse all 21340

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>