Dynamic rowsource for ComboBox

  • Thread starter Thread starter hbj
  • Start date Start date
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
 
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
 
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!
 
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!
 
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
 
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.
 
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>
 
Back
Top