Auto complete Dblookupcombobox

Asked

Viewed 517 times

1

I have a Dblookupcombobox2 with the following information:

42-batata
45-cebola
78-caneca
49-faca
79-livro

If the number is entered the search is done, but with letters does not work. For example I want to type "hit" and already see selected the record "42-potato".

In the Keypress event I am consulting by like what is typed in the Dblookupcomobox. My question is the following there is the possibility of appearing inside the component what I am typing, the way I am doing so far if I type "ba" does not appear visually inside the component.

  • I tested it here, and it really doesn’t, I’d have to do a hack, to manipulate the data, the tricky thing is to assign a new value to the combobox, there is no attribute ready for it. Have you considered stepping to a TDBComboBox ?

1 answer

1

I think the dblookup object will not perform the behavior you want.

But according to the first paradigm of the programmer that says the following: "Good code is the one that works"

To solve this problem you can do SQL as follows:

SELECT concat(cast(id as char(5)),'-' , nome ) as ID_NOME, tabela.*  FROM TABELA

Make the necessary calls in dblookup to the new ID_NOME field and you will get the desired functionality.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.