Link to home
Start Free TrialLog in
Avatar of SteveQ2
SteveQ2Flag for United States of America

asked on

VB6 Combobox.listindex = 40000 exceeds combobox limit

My VB6 app has approximately 40,000 entries in a combobox.  Setting the listindex field to get the user directly to an entry works great unless the listindex value is too high.  Setting the listindex generates a fatal error if the value is greater than 32,000ish.  It looks like the combobox listindex is an integer but I need it to be a single so I can take the user directly to item 40,000ish.  Is there a way to use listindex or some other way to scroll the combobox beyond the listindex default limit?
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

A VB6 combo box is limited to 32767 entries. (a Short Integer), and there is no work-around.  32676 is a FIXED, an un-changeable maximum.  

Why would you ever consider having that many entries in a combo box.  The user should never be required to scroll through that many entries.

AW
You would be better off using a grid.

Arthur is right that is the limit for comboboxes.  You might want to add a few radio buttons or something to breakdown whatever it is in your combobox to smaller more managable bits.

Thanks
Roger
Or use more than one combobox.
what is the nature of the values that you are trying to display in the Combo Box?

Can it logically be broken down into groups?

AW
Avatar of SteveQ2

ASKER

The screen contains several textboxes and a combo box at the top of the page which is used to initialize the values in the textboxes.  All of the controls are populated from one array of customer names, addresses, phone number, etc    The user can start typing the customer's name in the descending-by-customer-name combo box.  With each character that they type, the listindex field is increased to match the first listitem to match the customer name.  When they entered enough characters of the customer name in the combo box to find the customer, all of the text boxes have been automatically updated with that customer's contact information.  The listindex property's relationship to the customer field in the array was working perfectly until we exceeded the listindex small integer limit.
ASKER CERTIFIED SOLUTION
Avatar of Arthur_Wood
Arthur_Wood
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
Avatar of SteveQ2

ASKER

Thank you Arthur.  I have changed the design to use a pair of combo boxes as you suggested.  First drop-down list is to select starting characters (A-Z) of the client's last name.  Second is last names within the selected letter.  It reduced my combo addlist loop from 10 seconds to load all 40,000 records into one combobox to only 1 second to load the box with only the names beginning with the letter selected by the user.  Thank you.
Avatar of SteveQ2

ASKER

Thank you Arthur.  I have changed the design to use a pair of combo boxes as you suggested.  First drop-down list is to select starting characters (A-Z) of the client's last name.  Second is last names within the selected letter.  It reduced my combo addlist loop from 10 seconds to load all 40,000 records into one combobox to only 1 second to load the box with only the names beginning with the letter selected by the user.  Thank you.
Glad to be of assistance.  You should always be aware of what will be reasonable for a user.  Is it reasonable to expect your users to be willing to search through a list of 40,000 items?

AW