473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Is there an alternative to a combobox for selecting -- VB2005?

Greetings,

I have to load 30,000 unique names into a combox. Filling a dataTable takes
only a few milliseconds. But populating the combobox and displaying the list
takes several seconds - way too long. A user selects a name from the
combobox and runs a query.

Originally, this combox was on a form in an MS Access ADP which was linked
directly to our sql server. The combobox populated withins millisecnods.
How can I achieve this kind of performance in my VB2005 app? what is the
bottle neck here?

Thanks,
Rich
Jan 16 '07 #1
4 5066
30,000 items in a ComboBox, is just ridiculous. It might be nice an
convienient for you from a coding point of view but users are simply
incapable of dealing with that amount of information at once.

As you have found, MS Access has a lot of smarts (some might say dumbs) that
deal with this sort of stuff in the background but those 'features' are
specific to MS Access.

Surely there is some aspect about the 'list' of unique names that would
allow you to subset the information, say those unique names starting with
'A' or 'a'. This would mean that you only need to load a subset of the list
at any given time.
"Rich" <Ri**@discussions.microsoft.comwrote in message
news:A9**********************************@microsof t.com...
One thing I noticed about the Access combobox is that it is not loading
everything all at once. Like when you scroll in the Access combobox there
is
hesitation while it loads data... Whereas, the VB2005 combobox loads all
the
data at once.

I would prefer to load the data as needed rather than all at once and have
the form that contains the combobox display right away. Is there a
property
setting in the comobox somewhere to achieve this kind of behavior?
"Rich" wrote:
>Greetings,

I have to load 30,000 unique names into a combox. Filling a dataTable
takes
only a few milliseconds. But populating the combobox and displaying the
list
takes several seconds - way too long. A user selects a name from the
combobox and runs a query.

Originally, this combox was on a form in an MS Access ADP which was
linked
directly to our sql server. The combobox populated withins millisecnods.
How can I achieve this kind of performance in my VB2005 app? what is the
bottle neck here?

Thanks,
Rich

Jan 17 '07 #2
rich,

I assume your users are aware that if they start typing the list will
automatically scroll - right! otherwise I bet your company has had to
replace quite a few mice over the past year (scroll wheel dieing)...

That being said ... here is a work around...

------------------------
- text box ...

- delay timer event ...

- popup window ...

= user control!
------------------------

- user starts entering the persons name...
- wait for a split second delay in the typing ... or after the first 3 chars
are recieved... something.
- popup a window ... just below the text box ... populate a grid control in
the window ... filtered list of the 30,000 people based on user entries ...
allow the user to select a value in the popup!

....

if the user wants to 'scroll the entire' list looking for Stewart Smith ...
give'em a hot-key to popup the window ... retrieve the first 2000 records
.... show the popup ... in the background continue populating the list!

But I agree with Stephany, your design is flawed if you are presenting the
user with a combo box of 30,000+ options! I once had a college manually
scrolling our clients list (2,000 records) to find Simpson Construction Ltd
.... she had been doing this for 3 years ... i work over, typed Simp ... the
selection was in the box ... u should have seen her expression! So,
hopefully, you do not have a user that thinks they need to scroll the entire
list to find employee ... Zoo Zoo ...
Jeff


"Rich" <Ri**@discussions.microsoft.comwrote in message
news:A9**********************************@microsof t.com...
One thing I noticed about the Access combobox is that it is not loading
everything all at once. Like when you scroll in the Access combobox there
is
hesitation while it loads data... Whereas, the VB2005 combobox loads all
the
data at once.

I would prefer to load the data as needed rather than all at once and have
the form that contains the combobox display right away. Is there a
property
setting in the comobox somewhere to achieve this kind of behavior?
"Rich" wrote:
>Greetings,

I have to load 30,000 unique names into a combox. Filling a dataTable
takes
only a few milliseconds. But populating the combobox and displaying the
list
takes several seconds - way too long. A user selects a name from the
combobox and runs a query.

Originally, this combox was on a form in an MS Access ADP which was
linked
directly to our sql server. The combobox populated withins millisecnods.
How can I achieve this kind of performance in my VB2005 app? what is the
bottle neck here?

Thanks,
Rich

Jan 17 '07 #3

if you do this ... be careful not to create a lot of round trips to the
server...or a delay between the user entering a letter...

person enters SIM ...
delay after S to retrieve data and populate the combo box...
delay after I to retrieve data and populate the combo box... do not need to
retrieve ...S will have already populated cb with necessary records...
delay after M to retrieve data and populate the combo box ... do not need
this retrieve ... S will have already populated cb with necessary records...

person, clicks on the S and deletes it ... so ... not they have IM
delay ... combo box needs to retrieve and populate list...
user deletes M ... delay ... combo box needs to retrieve and populate
list...

you see where this is going ... you will be causing delay for the user and
you will have alot of round trips to the server.

plus, you will have to capture if the first letter the user entered has
changed ... causing your list to 'refilter'

The round trips are easy ... retrieve all the data for the list and cache it
in-memory...

The time will be 'purging the combo list' and 'refilling it'... this will
cause a delay ... the user will be typing and will not see anything...until
your have populated, purged, populated, purged, populated the combo box
value list.

I would recommend a timer event ... wait for a delay ... popup window ...
that 'looks' like a combo box.
Jeff.

"Rich" <Ri**@discussions.microsoft.comwrote in message
news:22**********************************@microsof t.com...
Thank you all for your replies. I did think about the subset idea. The
issue is with the Autocomplete feature. My users don't scroll. They let
the
name autocomplete. I can achieve the autocomplete feature nicely if I
pull
all 30,000 names. My main thing was to check first to make sure I am not
going to reinvent the wheel by coming up with another solution I had in
mind.
So it looks like implementing my other solution might not be reinventing
the
wheel.

The user types a letter. On the key up stroke I pull data from the server
for all names that start with that letter and set the combobox datasource
to
that list and then do the drop down thing. Well, I will give something
like
that a try.

Thanks again all for your replies.

Rich

"Rich" wrote:
>Greetings,

I have to load 30,000 unique names into a combox. Filling a dataTable
takes
only a few milliseconds. But populating the combobox and displaying the
list
takes several seconds - way too long. A user selects a name from the
combobox and runs a query.

Originally, this combox was on a form in an MS Access ADP which was
linked
directly to our sql server. The combobox populated withins millisecnods.
How can I achieve this kind of performance in my VB2005 app? what is the
bottle neck here?

Thanks,
Rich

Jan 17 '07 #4
Check into using a DataView on the Dataset. You can set the RowFilter
property to something like "CompName LIKE '" & ComboBox.Text.ToString & "*'"
Since you said that the dataset is populated very quickly this will give you
a subset of the DataTable without having to go back to the server. It will
only show you a portion of the DataTable. If you put this in the TextChanged
event the DataView will be refreshed with each letter even if the user
deletes a letter or something like that.

"jeff" wrote:
>
if you do this ... be careful not to create a lot of round trips to the
server...or a delay between the user entering a letter...

person enters SIM ...
delay after S to retrieve data and populate the combo box...
delay after I to retrieve data and populate the combo box... do not need to
retrieve ...S will have already populated cb with necessary records...
delay after M to retrieve data and populate the combo box ... do not need
this retrieve ... S will have already populated cb with necessary records...

person, clicks on the S and deletes it ... so ... not they have IM
delay ... combo box needs to retrieve and populate list...
user deletes M ... delay ... combo box needs to retrieve and populate
list...

you see where this is going ... you will be causing delay for the user and
you will have alot of round trips to the server.

plus, you will have to capture if the first letter the user entered has
changed ... causing your list to 'refilter'

The round trips are easy ... retrieve all the data for the list and cache it
in-memory...

The time will be 'purging the combo list' and 'refilling it'... this will
cause a delay ... the user will be typing and will not see anything...until
your have populated, purged, populated, purged, populated the combo box
value list.

I would recommend a timer event ... wait for a delay ... popup window ...
that 'looks' like a combo box.
Jeff.

"Rich" <Ri**@discussions.microsoft.comwrote in message
news:22**********************************@microsof t.com...
Thank you all for your replies. I did think about the subset idea. The
issue is with the Autocomplete feature. My users don't scroll. They let
the
name autocomplete. I can achieve the autocomplete feature nicely if I
pull
all 30,000 names. My main thing was to check first to make sure I am not
going to reinvent the wheel by coming up with another solution I had in
mind.
So it looks like implementing my other solution might not be reinventing
the
wheel.

The user types a letter. On the key up stroke I pull data from the server
for all names that start with that letter and set the combobox datasource
to
that list and then do the drop down thing. Well, I will give something
like
that a try.

Thanks again all for your replies.

Rich

"Rich" wrote:
Greetings,

I have to load 30,000 unique names into a combox. Filling a dataTable
takes
only a few milliseconds. But populating the combobox and displaying the
list
takes several seconds - way too long. A user selects a name from the
combobox and runs a query.

Originally, this combox was on a form in an MS Access ADP which was
linked
directly to our sql server. The combobox populated withins millisecnods.
How can I achieve this kind of performance in my VB2005 app? what is the
bottle neck here?

Thanks,
Rich


Jan 18 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Norm | last post by:
Hi, Each time the user selects an item from a combobox, I want that string to get appended to the values that were already selected. The result is that the combo is accumulating text each time...
5
by: Claudio Di Flumeri | last post by:
Hi all, Iive found this bug int the VB combobox and I'd like to know if there is a way to solve it... Put a combobox in a form, and fill it with these 3 items: - athens - berlin - chicago ...
8
by: Gregory A Greenman | last post by:
I have a minor, but somewhat frustrating, problem. In a program I'm working on, I've got a tabcontrol that contains several other controls, a few of which are comboboxes. In the IDE, one of the...
7
by: Simon Verona | last post by:
I posted this in dotnet.languages.vb.controls but thought I'd post here as well.. I have a combobox that is bound to a dataview generated from a dataset. The dataset has a single table...
11
by: Martin | last post by:
Hi all! In VB6.0 A combobox had items, which basically were the description and ItemData which could be used to create a link to a record, that is if the recordset had a numeric key. I was...
4
by: Matt | last post by:
I have been searching all over the web for a way to sort a DataGridView based on the actual text being shown in a ComboBox column as opposed to the underlying value (an ID in this case). Can anyone...
2
by: shumaker | last post by:
I have a combobox that is very much like the one found in the RSS project here: http://msdn.microsoft.com/vstudio/express/visualCSharp/learning/ My projectNameComboBox basically is filled with a...
19
by: billa856 | last post by:
Hi, I have to use the table(PRODUCTION) already generated in MS Access in which all fields are of TEXT type.fields like (orderdate,palletno,customercode,itemno,pono,carto n,pcs,totalquantity)Now i...
1
by: beemomo | last post by:
hi everyone! i need to display all the data of a record in a form by selecting the value of combobox. for example when i select a Project_No display in combobox, the correspondence data of that...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.