Solved

Sort order in Collections

Posted on 1998-08-20
1
137 Views
Last Modified: 2010-04-30
Are VB collections always sorted by key?
i.e. if I add items only using data and key (not after:= or before:=) will For Each ... enumerates items in order of keys?
In other words - I need the *sorted* list of items. May I just use collections for that purpose and be sure that it will work... ? If no - what may I use except sorted ListBox?
0
Comment
Question by:dksqrt
1 Comment
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 50 total points
ID: 1430097
You can't use collections for that-they contain items in the exact order you added them. You you want sorted items, you can add them to listbox and collection at the same time, and set .ItemData of the list to the index of the same item in the collection, so you can refer to it later
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

828 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