Link to home
Start Free TrialLog in
Avatar of Wilder1626
Wilder1626Flag for Canada

asked on

VB6 - Feed Listbox with distinct value from MSHFlexgrid2 column 16

Hi

I have this MSHFlexgrid2 populated with more than 1000 rows of data.

I would like to create a command button that will feed my List1 with distinct values from column 16 of my grid, and also orders by  numbers.

How can i do that?

The values format i have in my grid column 16 looks like this:
000-00-0000
111-11-1111


How can I do that?

Thanks for your help
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Can you post a zip of the project please?
Avatar of Wilder1626

ASKER

Hi MartinLiss

Here is a sample. In column 16, you will found values, some in duplicates, but only single values should show in the List1 checkbox style.
ListBox-sample.zip
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The result of a test where clicking the button causes the sub to be run 1000 times yields these results on my PC where Test1 is my code and Test2 is aikimark's. I clicked the button 4 times for each set of code. The results are in milliseconds timed using the method described in my How to Time Code article.

Test 1: 125
Test 1: 141
Test 1: 140
Test 1: 141

Test 2: 312
Test 2: 281
Test 2: 281
Test 2: 453

I should also say that you most likely won't notice the difference and that referring to a particular item is often easier with dictionaries than with collections but here we are just writing it all to the list so that doesn't come into play.
Thanks for testing, Martin.
You're welcome.
HI again

I like both options, but i do see a difference with MartinLiss version due to the number of record i have.

But this is exactly what i was looking for. Thanks again.
You're welcome.