473,503 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sort number field in list view vb6

23 New Member
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
1 5907
danp129
323 Recognized Expert Contributor
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

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

Similar topics

7
2577
by: Nova's Taylor | last post by:
Hi folks, I am a newbie to Python and am hoping that someone can get me started on a log parser that I am trying to write. The log is an ASCII file that contains a process identifier (PID),...
1
2305
by: Michael Hill | last post by:
I have a section of a stylesheet (below) I am trying to configure. The part I am having trouble with is the when test. I have a series of pulldowns that I can select from, some are text and some...
20
4023
by: Xah Lee | last post by:
Sort a List Xah Lee, 200510 In this page, we show how to sort a list in Python & Perl and also discuss some math of sort. To sort a list in Python, use the “sort” method. For example: ...
11
3874
by: James P. | last post by:
Hello, I have a report with the Priority field is used as sort order and grouping. The problem is the data in this Priority field if sorted in ascending order is: High, Low, and Medium. How...
3
6161
by: Jim Adams | last post by:
I'm counting the frequency of word occurances and would like to return a key/value list sorted descending by frequency. So I need to quickly see if a word (key) is in the list, but later sort...
2
2291
by: missnaughton | last post by:
Hi I'm designing a query for our hockey coach to print out players' names to stick on game sheets. I could sort the query results based on Jersey number, but the problem is the 2 goalie names...
9
1986
by: active | last post by:
Can you see why this does not sort the list? It displays OK but is not sorted Thanks for any help
10
13691
by: Dixie | last post by:
I am appending some new fields to a table in vba and when I append a number field with is a byte, it does not inherit any format. I want it to be the General Number format, but it is blank. I...
0
1464
by: Amar | last post by:
Hi, I have a generic list with a some objects of a particular class in it. I have implemented a IComparer for the the class and pass it to the List. The list.sort method works fine when the value...
0
7076
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7274
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7453
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5576
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
1
5005
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4670
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3162
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1507
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.