VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



datagrid simply sort

by gubo (1 Submission)
Category: Databases/Data Access/DAO/ADO
Compatability: Visual Basic 5.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (6 Votes)

a simply sort on de collumsheaders of a datagrid

Inputs
a datarid,and a connection with a d-base
Code Returns
sort "asc" & "desc"

Rate datagrid simply sort

Private Sub DataGrid1_HeadClick(ByVal ColIndex As Integer)
  With AdoBoeken.Recordset
    If (.Sort = .Fields(ColIndex).[Name] & " Asc") Then
      .Sort = .Fields(ColIndex).[Name] & " Desc"
    Else
      .Sort = .Fields(ColIndex).[Name] & " Asc"
    End If
  End With
End Sub

Download this snippet    Add to My Saved Code

datagrid simply sort Comments

No comments have been posted about datagrid simply sort. Why not be the first to post a comment about datagrid simply sort.

Post your comment

Subject:
Message:
0/1000 characters