Attachment 95727
I have searched the net and forums for the answers, and have tried many, but still can't get this right.
I am trying to sort a msflexgrid (grid1) by a column which lists birth dates.
Here is an excerpt of my code, and a picture of what I get. (Note that the dates are NOT in order). What did I miss?
then I used the grid's built in sort routine:
I have searched the net and forums for the answers, and have tried many, but still can't get this right.
I am trying to sort a msflexgrid (grid1) by a column which lists birth dates.
Here is an excerpt of my code, and a picture of what I get. (Note that the dates are NOT in order). What did I miss?
Code:
grid1.TextMatrix(x, 2) = rs!child1
grid1.TextMatrix(x, 3) = Format(rs!child1Bday, "YYYY-MM-DD")
age = DateDiff("YYYY", rs!child1Bday, Date)
If age > 1 Then
grid1.TextMatrix(x, 4) = age & "years"
Else
grid1.TextMatrix(x, 4) = DateDiff("M", rs!child1Bday, Date) & "months"
End If
Code:
grid1.Col = 3
grid1.Sort = flexSortNumericDescending