I had a similar problem. I had a drug list with 120,000 records and also
wanted to use a combo box. I wrote a dll that would allow the user to enter
a partial or full text drug name or drug code. I set up a Max property that
would default to 200. Meaning that if you, the programmer, didn't set the
Max it would default to 200. No more than 500 could be brought back.
Anymore than that and that's too much. The user could type in 'tylen' for
instance, and all records with 'tylen' would be returned and the user could
select from this much smaller list. If 200 of say 700 'tylen' records were
brought back and the record the user wants has not been displayed, they can
supply more information on the search criteria, such as 'tylenol 500mg', and
that would return an exact match. I also allowed the user to type in a "$"
before the 'tylen' and it would return every record that contains 'tylen'
somewhere in its drug name.
The combo box will allow you to place more than 32,767 items in it.
Althought not a good idea. Attached is a small project that adds 68,000
items to a combo box. What happens is when the 32,768th item is added, its
ListIndex is set to -32,768 and decrements back to 0 and then starts
incrementing back up to 32,767 and so on and so forth. This does not affect
your ability of setting the ListIndex to -1 and going to the top of the
combo box data. But good luck trying to set the ListIndex to -32,768,
you'll receive an 'Invalid Property Value' error. Anyway, this is
definately not the best method.
I don't know if this will help, but it is a much better way to narrow the
users search results without sentencing them to scrolling through thousands
of records regardless of your control selection.
Mark