Link to home
Start Free TrialLog in
Avatar of JohnE
JohnE

asked on

Typing help (autocompletion) in DBComboBox

I have a database app. in which one of the fields is "author". When the user starts entering the author name I want to be able to give "typing help" (eg IE4 address bar). That is as they type the author name it will compare it to the items in the combobox and bring up the nearest match as they continue to type - autocompletion style.

Thanks

John
Avatar of SOLHJOO
SOLHJOO

Please check DBlookupcombo or DBlookuplist....
ASKER CERTIFIED SOLUTION
Avatar of Matvey
Matvey

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
All the list box and combobox has the "autocompletion" feature if the list is sorted. However if you are using delphi 1, the autocompletion works only when the (16bits) program is running under windows95. When delphi 1 program runs under win3.11, the listbox/combobox works differently: if you continuously press a character, the next items beginning with that character will be selected. eg If you press B repeately, you may get Ball, followed by Bell, Bill, Bull ... etc.

I think I've even seen some control like this as a db-aware. Lookup of some kind with this option. I'll try to find it again...
OK, I found it, but it's not what I thought. Close, but not better than the one I posted above. If you still want to take a look: http://bes.trendline.co.il/torry/vcl/packs/accomp.zip

Anyway, what I'd do if I was on your place, is get the list of all the names like
SELECT DISTINCT Name FROM Authors;
And then post them all to the autocompletion list (in the first pair of components I posted).
Avatar of JohnE

ASKER

Thanks Matvey, I used the component from your first answer and worked my code around it and it works fine!

John