By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 2,042 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

sort number field in list view vb6

P: 23
hi
Expand|Select|Wrap|Line Numbers
  1.    With ListView1
  2.         .SortKey = ColumnHeader.Index - 1
  3.         .SortOrder = IIf((.SortOrder = lvwAscending), lvwDescending, lvwAscending)
  4.         .Sorted = True
  5.     End With
this the code for sorting list view can any one tell me why it does not sort serial number in vb6

Its argent
May 8 '07 #1
Share this Question
Share on Google+
1 Reply


danp129
Expert 100+
P: 321
hi

With ListView1
.SortKey = ColumnHeader.Index - 1
.SortOrder = IIf((.SortOrder = lvwAscending), lvwDescending, lvwAscending)
.Sorted = True
End With

this the code for sorting list view can any one tell me why it does not sort serial number in vb6

Its argent
There's better ways but you could preceed the numbers with 0's:


Replace(Space(13 - Len(myval)), " ", "0") & myval

.. or use spaces and right align the column if it's not the first column :
Space(13 - Len(myval)) & myval
May 8 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.