guitardave78
Programmer
Hey hey i'm back
I now have my listview with small icons , populated from an access database and i can sort it using
Public Sub LV_ColumnSort(ListViewControl As ListView, Column As ColumnHeader)
With ListViewControl
If .SortKey <> Column.Index - 1 Then
.SortKey = Column.Index - 1
.SortOrder = lvwAscending
Else
If .SortOrder = lvwAscending Then
.SortOrder = lvwDescending
Else
.SortOrder = lvwAscending
End If
End If
.Sorted = -1
End With
End Sub
But i would like to sort the date properlly.
I will explain
The date is sent to the database as MM/DD/YYYY HH:MM:SS
but to sort it nicely it has to be swaped to YYYY MM DD
so that they order in most recent to oldest
and that looks a bit cack. Any way of doing this without having to requery the database?
I now have my listview with small icons , populated from an access database and i can sort it using
Public Sub LV_ColumnSort(ListViewControl As ListView, Column As ColumnHeader)
With ListViewControl
If .SortKey <> Column.Index - 1 Then
.SortKey = Column.Index - 1
.SortOrder = lvwAscending
Else
If .SortOrder = lvwAscending Then
.SortOrder = lvwDescending
Else
.SortOrder = lvwAscending
End If
End If
.Sorted = -1
End With
End Sub
But i would like to sort the date properlly.
I will explain
The date is sent to the database as MM/DD/YYYY HH:MM:SS
but to sort it nicely it has to be swaped to YYYY MM DD
so that they order in most recent to oldest
and that looks a bit cack. Any way of doing this without having to requery the database?