?
Solved

VB6 - Sorting data alphabetically from a list box

Posted on 2003-02-26
6
Medium Priority
?
2,063 Views
Last Modified: 2010-08-05
Hey,
I have a list box with 30 surnames,
how do i sort the data alphabetically ?
0
Comment
Question by:billy_mac
5 Comments
 
LVL 18

Accepted Solution

by:
deighton earned 80 total points
ID: 8024329
in design mode

ListBox.sorted=true
0
 
LVL 1

Assisted Solution

by:sazhagianambi
sazhagianambi earned 80 total points
ID: 8024457
Hi,

        In List Box There is One Property called Sorted. If U Set this as Tru It will be Sorted Automatically.
        If You Have the Items in Array then Use the Following Logic,
Consider Arr as Array Having Set Of Strings

Dim Temp
 For i=0 to Ubound(Arr)
  For j=0 to UBound(Arr)
      If arr(i)>arr(j)
          temp=arr(i)
          arr(i)=arr(j)
          arr(j)=temp
      endif
  Next
 Next
Now Arr have the Sorted Elements.

Regards,
Nambi.
0
 

Author Comment

by:billy_mac
ID: 8025045
Nice one deighton and Nambi.
0
 

Expert Comment

by:CleanupPing
ID: 8901090
billy_mac:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8972945
Moderator, my recommended disposition is:

    Split points between: deighton and sazhagianambi

DanRollins -- EE database cleanup volunteer
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

616 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question