Does anyone know the max number of values that can be added to a listbox. I am getting to about 32168 and then getting an error that the array can add any more values.
If there is a limit, does anyone know of an alternative to using the listbox?
The limit just under the maximum value an integer can be. This is because the index is set as an integer, rather than a long value.
I would have to question the usefulness of this control however when you have over 30,000 items in the list. Is there not a way to group items, and then populate another list box with a second choice. for example: vegetables from 1st - carrots in the second, rather than listing fruit and vegetables in the first listbox?
BB, suppose if the listbox contains 30,000 plus veg in the listbox and it might contain 30,000 plus fruit in the fruit listbox????
I understand what you are saying about the grouping (and it sounds like a very good idea if possible) but if we could ask gbarsley how many records he could be trying to add to the control he might be able to help us answer his question.
I am trying to add all of them to a listbox and then search.
If anyone has a suggestion on another solution, I am all ears.
I have a text file in the following format:
"012345","1"
"567890","5"
"016436","8"
There are 180,000 of the above.
I have a form where the user enters the six digit number in the first field and clicks a button, the button searches the text file and if the number is found it displays the second value in a label.
You could use ADO to connect to the text file, and then issue SQL against it. For over 180,000 students, I would like to see this in a proper database within an indexed table anyway.
180'000 by what many of us know as "table-scanning" is just going to be painful...
There is no scrolling. This is going into a listbox that is not even visible on the form. I was just using the listbox to make it easier to search.
Does anyone have any code samples on how I can accomplish this easier?
All I have displayed for the End User is a Text Box to input the Student ID number, a Label to show the Eligibility Value returned from the search for the Student ID number and a Command Button to perform the search.
Can you not just query the database (sorry but I asume you areb using a database for the back-end) using the user entered values rather than using the listbox???
says that it has an ODBC driver. Just download that and do a query as has been suggested above
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'If we're supposed to work in Hex, why have we only got A fingers?'
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.