Reputation: 1453
I want to enable the user to enter a contact name in an data-aware edit control (combobox, edit) with autosuggest items bound to an sql table. What I want to achieve is this: a combo bound to Contact_Name field of a datasource, an edit bound to Contact_Tel of same datasource an edit bound to Contact_Email of same datasource
The combo dropdown should be bound to a sql datasource and display person name, phone number and email. The user can pick one of the existing options or type an arbitrary name (new contact person). When the text of the contact person combobox changes, then - if the text matches one of existing options, two other edit controls are filled with the phone number and email of the option selected, or - if the text is not in list, the other two edit controls are cleared.
The set up that I currently have is a dbLookupComboBoxEh bound to a field of a dataset + a listsource with key and listfields + style = csDropDownEh.
The problem is that it works fine when the user types in a value that is contained in the list source, but once I type in something that is not on the list the control simply gets cleared and doesn't remember the value any more.
Is there a control that combines a data-bound drop down with suggested values AND ability to enter ARBITRARY text?
Upvotes: 0
Views: 388