Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox Question

Status
Not open for further replies.

gbargsley

MIS
Nov 2, 2004
44
0
0
US
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?

Thanks
Garry B
 
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?

Just a thought

BB
 
Hi,

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.

My two penneth

Harleyquinn

---------------------------------
For tsunami relief donations
 
I have a text file with 180,000 student records.

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.

 
Please see the comments made on this scenario in thread222-993926
 
Why use a list box?

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...

mmilan
 
This is in a proper database.... FileMaker.


No one answered my post last week about connecting Visual Basic 6.0 to a FileMaker 7.0 file.

That is why I decided to go with this export.
 
Regarding connecting FileMaker with VB, you may want to contact FileMake support to see if they have an ODBC/OLEDB driver for their database.

Still don't understand why in the world you put 180,000 names in a listbox. I sure would hate to be that user...
 
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.

Garry
 
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???

Harleyquinn

---------------------------------
For tsunami relief donations
 
The Filemaker site ( 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?'

for steam enthusiasts
 
gbargsley,

Did you try Dictionary object instead of invisible listbox?

vladk
 
I figured out a better way to do this.

I have a SQL server that hosts all of this data. I am running a SQL query to return the value that I am looking for.

Thanks for everyones input.

Garry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top