Solved

Index rows in a combobox

Posted on 2000-04-25
16
335 Views
Last Modified: 2013-12-26
It is possible to add more than 32768 rows to a combobox, but how can I index the rows that are over 32768?
0
Comment
Question by:coppe
  • 4
  • 4
  • 3
  • +2
16 Comments
 
LVL 14

Expert Comment

by:wsh2
ID: 2750192
Why in Gawd's name would you want to put 32,000 entries into a combobox? Thankfully the answer is NO you cannot add more. Tell us a little bit more about what you are trying to do.. before your vertical scroll bar thumb becomes no larger than a pinhead.. <smile>.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2750566
no doubt, why so many in a combobox?  who is going to pull that baby down and scan for an entry?  once we get a better idea of what youre trying to do we can figure out a more practical workaround.
0
 

Author Comment

by:coppe
ID: 2750788
When the user make a input in a textbox a selection is made in the combobox and the first row which is equal to the input is shown in the combobox. The user can then click on the combobox and select among the rows who starts with the input. The design of the form doesn't allow a bigger control than the combobox.
0
 
LVL 14

Expert Comment

by:wsh2
ID: 2751814
coppe.. we understand that.. but why on earth do you want to put 32kb entries into the combo? That's kinda like storing Webster's entire Dictionary into the combobox so that the user can find a single word. It can be done.. but it just isn't practical.. scrolling through 32,000+ entries just ain't fun. As a programmer, you want to make your user interface friendly and intuitive.. not a thumb scrolling drudge. So if you would, please be more specific about what you are putting into your Textbox and then what you want to see in your Combobox.. and lets see if we can tweak this into something where the 32,000+ entries is no where near a limitation to your application.. <smile>.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2751830
also with 32K entries, even with autocompletion i would imagine a good amount of scrolling will be needed to find the item they are looking for, unless they happen to know the entire string they are looking for practically.
0
 
LVL 18

Expert Comment

by:mdougan
ID: 2753156
Why don't you have your users type into a textbox a few characters and then click a button next to the textbox that says find:

Or, an alternative, they type into the combo box as before, except that the combo starts out empty.  Then, when they click the down arrow, the Drop_Down event fires, then you'd do the stuff below:

You then "select * from yourtable where description like '" & txtInput.text & "%'".  You may get several results back, in which case you could populate the listbox with that.
0
 

Author Comment

by:coppe
ID: 2754223
The 32k are article numbers for a wholesale dealer. This amount of article numbers are nohing unusual for that kind of customer. After every new sign of the article number the user put in the textbox a new selection is made in the combobox which decrease the scrolling. Of course you don't scroll through 32k,  but yes it is true that you must know almost the whole string to avoid to much scrolling.

Maybe it is better to start with an empty combobox and populate it only with the article numbers who starts with the input from the textbox.
I don't avoid the scrolling problem with this solution, but I don't think there is anything to do about that.
I think the time to fill the combobox is to high, but I will give it a try.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2754229
having these numbers stored in a database you could display them in a grid for example, performing a query with the 'LIKE' operator depending on what the user has typed in of the article number
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 14

Expert Comment

by:wsh2
ID: 2754447
Adding to Azra's comment:

And as the grid is multicolumn.. complete with a scroll bar.. you could easily present more article numbers on each given screen. To make thingz even nicer, you can then click on the desired article number (in any column)and present the appropriate screen from there. Oh.. and yes.. Azra's suggestion to do LIKE positioning will work very efectively there as well.. as the cursor and grid can be positioned as the user types into the textbox.

To be honest, you really should consider setting up text searchs rather than article number selections. Keywords are much more user friendly than numbers ever could be. Additionally with keywords, users are accustomed to waiting for a bit of a response, something they will not be as patient with when searching on an abstract number.
0
 
LVL 1

Expert Comment

by:tirupur_selva
ID: 2809209
I have another option. This would provide the user  0% scrolling.
You can add the 32k entries in to the combo box while the form is loading itself. Then while the user types in the textbox, you can match the text in the text box with that of the combo box using APIs and the matching item in the combo box will be highlighted. Then, the user can click the highlighted item for further entries. If you are convinced with this, I can give you the source code for the above logic.
Expecting your consent!
Regs
Selva
0
 

Author Comment

by:coppe
ID: 2809519
The suggestion to the start with an empty combobox and populate it only with the article numbers who starts with the input from the textbox is a little bit too slow.

The grid suggestion is good but as I wrote before the layout is not allowing more than a textbox and a combobox.

I maybe misunderstand you Selva, but how do you avoid scrolling without typing almost the whole string?
I already add the entries when the form is loading.
0
 
LVL 18

Expert Comment

by:mdougan
ID: 2812715
If you try to populate the list as you type, this will definately be too slow, but how about the idea of having the user type some characters and then click a Find button, to fill the list with all matches.  That way, if they want to work on the A's they type in an A and then Find, and the list is full of entries that Start with A, when they're ready for the B's they type B and then Find, and the list has B's in it.
0
 
LVL 18

Accepted Solution

by:
mdougan earned 100 total points
ID: 2812720
On other option you have is to go out and get your recordset, but only populate the combo with the first 100 records.  Then, as the user scrolls down, or if the combo autoscolls, then you can perhaps keep track of the selected item, and when you get to within 20 or 30 of the bottom of the list, then you populate the next 100 items from the recordset.  That way, they might have lots of little pauses as you fill some more records, but it works ok.
0
 
LVL 1

Expert Comment

by:tirupur_selva
ID: 2812867
Hi mdougan,
   I think you have misunderstood my comments. I didn't mean to 'populate' the combo box while the user types in the text box, the typed text in the text box would just be 'matched' with that of the combo box. The items would be filled in the combo box while the form is loaded itself.  
   If you are still not clear with this logic, then I'll put my code here. you can work it out.

Coppe, you need not scroll at all. The API will do the trick. As you have said, fill the combo box while the form is loaded. After that, all you have to do is type the text in the text box and nothing else. When you type, you could see the exact match in the combo box. Hope you understand now. Actually, its not as difficult as you think.

Regs
Selva
0
 
LVL 18

Expert Comment

by:mdougan
ID: 2815582
No, I understood correctly, but the problem here is that you don't want to try to load anywhere near 32.000 items into a combo box -- either at form load or otherwise.

So, the question is, how can you populate the listbox with (much) less than 32,000 items, and still give the user the ability to search through all of the items in the database.

The way that I've done this is to either have a textbox(s) on the form that the user types stuff into, and then clicks search, and you go back and retrieve all records that match the criteria, or if you give them a list or grid to scroll through, then as the user scrolls down the list, when they get near the bottom of the list, then you go out and get the next batch of records.

Both of these techniques work pretty well in the user interface.
0
 

Author Comment

by:coppe
ID: 2880146
Comment accepted as answer
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now