Topic: Replacing the ComboBox with the ability to search and add data to DB

Всем привет!
Не смог понять как можно выполнить одновременный поиск, проверку на дубликат записи и добавление новой записи в БД штатным ComboBox. Пришлось выкручиваться. Вот что получилось.
Буду рад любому комментарию или совету.
Спасибо заранее и успехов! 


Hello!
I could not understand how it is possible to perform a simultaneous search, check for a duplicate record and add a new record to the database with a regular ComboBox. I had to get out. Here's what happened.
Any comment or advice would be welcome.
Thanks in advance and good luck!

-----------
with Google translation

Post's attachments

Attachment icon LIKE_COMBO.rar 299.51 kb, 239 downloads since 2020-09-02 

I'm just learning

Re: Replacing the ComboBox with the ability to search and add data to DB

Check out this post. Maybe it is what you're looking for.
Прочтите этот пост. Может быть, это то, что вы ищете.

http://myvisualdatabase.com/forum/viewtopic.php?id=5188

brian

3 (edited by Ronin751 2020-09-03 09:02:37)

Re: Replacing the ComboBox with the ability to search and add data to DB

brian.zaballa,

Спасибо за ссылку! Это действительно хороший вариант и более компактный. Немного переделал под свои нужды. 

Thanks for the link! This is a really good option and more compact. Modified a little to fit your needs.

-----------
Google Translate

I'm just learning

Re: Replacing the ComboBox with the ability to search and add data to DB

When I choose No it's delete the existing value from the record field.
How to solve it? or better when inserting an non existing record in the combobox how does it work before we press the save button ?

Re: Replacing the ComboBox with the ability to search and add data to DB

Jo hi any news?? It's a very nice function but when i press no the value of the combobox change to an empty box. How can i leave the value when i choose no? Really it's a very nice trick.

Re: Replacing the ComboBox with the ability to search and add data to DB

Прошу прощения, но не могу понять что вы имеете в виду. имитация раскрывающегося списка выполнена за счет поля EDIT (в него вводится значение). При вводе данных в поле происходит стандартный отбор из БД: поиск строк у которых есть набор искомых значений. Отобраный список выводится в Tablegrid . Если значений которые удовлетворяют поиск не найдено - TableGrid  не отображается.
Перемещение по списку Tablegrid  выполняется как клавишами вверх и вниз, так и курсором мышы. Для подтверждения выбора используем либо Mouse Dbl Click  либо нажатие Enter. Перед добавлением данных в БД выполняется проверка на отсутствие дублирующихся значений.
О каком "нет" Вы говорите?   

I am sorry, but I cannot understand what you mean.
The imitation of the drop-down list is done using the EDIT field (a value is entered into it). When entering data into a field, a standard selection from the database occurs: search for rows that have a set of required values. The selected list is displayed in the Tablegrid. If no values are found that match the search, the TableGrid is not displayed.
Moving through the Tablegrid list is performed both with the up and down keys and with the mouse cursor. To confirm the selection, use either Mouse Dbl Click or pressing Enter. Before adding data to the database, a check is performed for duplicate values.
What "no" are you talking about?

------------
google translation

I'm just learning