Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SORT DATE in msflexgrid not correct

sal21

Programmer
Apr 26, 2004
476
IT
Rich (BB code):
Private Sub MSFlexGrid1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

'https://www.tek-tips.com/viewthread.cfm?qid=1819041&action=updated

'1-flexSortGenericAscending
'2-flexSortGenericDescending
'3-flexSortNumericAscending
'4-flexSortNumericDescending
'5-flexSortStringNoCaseAsending
'6-flexSortNoCaseDescending
'7-flexSortStringAscending
'8-flexSortStringDescending

    Dim CL As Integer, RW As Integer, CN As Long
    
    'Static blAscending As Boolean

    With Me.MSFlexGrid1
    
    RW = .MouseRow

        If Me.LNR.Caption >= 1 Then

            CN = Me.LNR.Caption

            If .MouseCol = 1 And Button = vbLeftButton And RW = 0 Then

                '.Visible = False
                .Redraw = False

                .RowSel = CN
                .ColSel = 52

                If strSort = 1 Then
                    .Sort = 3
                    strSort = 2
                    'If Not blAscending Then
                Else
                    .Sort = 4
                    strSort = 1
                    'blAscending = False
                End If

                .TopRow = 1
                .Redraw = True
                '.Visible = True
                'Call APRI_STRADA(1)

            End If

        End If

    End With

    Me.Text1.SetFocus

End Sub

i have formatted the date in (hide) column 52 with:

.TextMatrix(R, 52) = Format(STRDBROW(1, K), "yyyymmddhhnnss")

correct?

note:
the date in array have thuis format: dd/mm/yyyyy
 
>SORT DATE in msflexgrid not correct

In what way is it wrong

>the date in array have thuis format: dd/mm/yyyyy

Just to make certain, the regional shortdate format on your PC is?
 
It is customary here at TT to share (even your own) solution so others who may have the same issue can benefit.
 
Instead to set .col=nn
I have set .colsel=nn
Thats Is all.
 

Part and Inventory Search

Sponsor

Back
Top