ITableSort Sort method in VBA

Discussion created by kjkim134 on Feb 22, 2011
Latest reply on Feb 23, 2011 by kjkim134

Using my VBA codes, I was trying to sort an attribute table based on two fields, but the ArcMap stopped working immediately after the codes were run.  Actualy, the codes were composed based on sample codes to the best of my guess; particularly, I don't understand why "Nothing" is put there on the last line.  Would someone please explain about it and how to complete the macro for it to run well?


    Dim pTableSort As ITableSort
    Set pTableSort = New esriGeoDatabase.TableSort
    Dim pTable As ITable
    Set pTable = pTableProperty.Table
    Set pTableSort.Table = pTable
    pTableSort.Fields = "OBJECT_ID, UFI"
    pTableSort.Ascending("OBJECT_ID") = True
    pTableSort.Ascending("UFI") = True
    pTableSort.Sort Nothing


Thank you!