• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 156
  • Last Modified:

Searching Combobox to see if string exists

I have a dbcombobox with a items list of authors. If the text the user enters is not an author already in the combobox list I want to be able to add it to the list (without getting multiple entries for the same author).
0
JohnE
Asked:
JohnE
1 Solution
 
sassas081597Commented:
Hi!
Pls, Say what you really need:
1) The procedure which compares New Author and all other Autors before Post an Author or
2) the same but while the user types smth in the box?
0
 
erajojCommented:
Easiest way (case insensitive):

AlreadyThere := (ComboBox.Items.IndexOf(NewEntry)<>-1);
if not AlreadyThere then begin
  ComboBox.Items.Add(NewEntry)
end;

/// John

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now