By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,558 Members | 1,399 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,558 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a

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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.