samspreen

TableSort is not working

Discussion created by samspreen on Jun 25, 2010
Latest reply on Jun 28, 2010 by kirkktx
Dear All,
I am using following code to sort a table by "area" column. Though the code runs normally but I do not see any change in my Table. Am I missing something?
Thanks in advance,
Sam

Private Sub Test_Click()
Dim pDoc As IMxDocument
Set pDoc = ThisDocument
Dim pMap As IMap
Set pMap = pDoc.FocusMap
Dim pFeatureLayer As IFeatureLayer
Set pFeatureLayer = pMap.Layer(0)
Dim pFeatureClass As IFeatureClass
Set pFeatureClass = pFeatureLayer.FeatureClass
Dim pTableSort As ITableSort
Set pTableSort = New TableSort
With pTableSort
    .Fields = "area"
    .Ascending("area") = True
    Set .Table = pFeatureClass
End With
pTableSort.Sort Nothing
End Sub

Outcomes