Dynamic rowsource for ComboBox

H

hbj

I need a combobox with a dynamic rowsource following what user enters
into the box. As user presses a letter, the rowsource shrinks to meet
the string entered so far. If user pressess backspace, the rowsource
expands accordingly.
Thnx in advance
Hakan
 
H

hbj

I need a combobox with a dynamic rowsource following what user enters
into the box. As user presses a letter, the rowsource shrinks to meet
the string entered so far. If user pressess backspace, the rowsource
expands accordingly.
Thnx in advance
Hakan

Is my problem too complex or too easy, or unclearily explained,
because nobody has answered?
Hakan
 
G

GS

hbj submitted this idea :
I need a combobox with a dynamic rowsource following what user enters
into the box. As user presses a letter, the rowsource shrinks to meet
the string entered so far. If user pressess backspace, the rowsource
expands accordingly.
Thnx in advance
Hakan

I suspect you're trying to make a combobox work like a 'google'
combobox does. Normally, continually pressing the first character of
any list itme causes the combobox to 'cycle' through all the list items
that begin with that character. If the list is 'unique' then you'd get
the list item with a single keystroke.

I'd expect that to duplicate that behavior with VBA it would result in
a serious performance it to continuously 'filter' the list items one
keystroke at a time. It's an interesting concept, though, and I might
be able to test ways to accomplish it, ..time permitting!
 
G

GS

Sorry about the typos...

I suspect you're trying to make a combobox work like a 'google'
combobox
does. Normally, continually pressing the first character of any list
item causes the combobox to 'cycle' through all the list items that
begin with that character. If the list is 'unique' then you'd get the
list item with a single keystroke.

I'd expect that to duplicate that behavior with VBA it would result in
a
serious performance hit to continuously 'filter' the list items one
keystroke at a time. It's an interesting concept, though, and I might
be able to test ways to accomplish it, ..time permitting!
 
H

hbj

Sorry about the typos...

I suspect you're trying to make a combobox work like a 'google'
combobox
does. Normally, continually pressing the first character of any list
item causes the combobox to 'cycle' through all the list items that
begin with that character. If the list is 'unique' then you'd get the
list item with a single keystroke.

I'd expect that to duplicate that behavior with VBA it would result in
a
serious performance hit to continuously 'filter' the list items one
keystroke at a time. It's an interesting concept, though, and I might
be able to test ways to accomplish it, ..time permitting!

--
Garry

Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc

I tested many solutions, but found a quick an dirty solution: I use a
textbox to enter the search string (=name), I search for that string
in the address book (Excel column) and add matches to a separate
listbox. It works! With 500 names, fast enough. If you find a more
sofisticated way, pls let me know.

Hakan
 
V

Vacuum Sealed

Hi Hakan

I know in Access Forms.Combobox property you can set it's "Limit to List" to
=Yes so that it only looks a names within the list and as you type in each
character, the names/words update at the same time.

I'm not all that experienced with Excel Comboboxes and am unaware if they
have similar property settings.

Garry Maybe able to provide extra insight into that particular property
setting.

HTH
Mick.
 
G

GS

Vacuum Sealed pretended :
Hi Hakan

I know in Access Forms.Combobox property you can set it's "Limit to List" to
=Yes so that it only looks a names within the list and as you type in each
character, the names/words update at the same time.

I'm not all that experienced with Excel Comboboxes and am unaware if they
have similar property settings.

Garry Maybe able to provide extra insight into that particular property
setting.

HTH
Mick.

Hi Mick,
You can duplicate the Access ComboBox behavior in Excel by using the
Change event to run a procedure that reloads the list based on the
characters typed into the combobox. Also, the same 'effect' can be
achieved using the Change event for a TextBox and populating a ListBox
where users can make selections.

The latter is how the Index tab in online help works: as you type
characters in the 'keywords' textbox the 'choose keywords' textbox
scrolls to match the typed characters. This behavior demos the 'effect'
of using the Change event. In the OP's case this could be modified to
display the desired list items. Note that the same thing -could- be
done with a combobox but using the textbox/listbox together is, IMO,
more intuitive.<g>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top