Solved

Searching Combobox to see if string exists

Posted on 1997-09-26
2
145 Views
Last Modified: 2012-05-04
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
Comment
Question by:JohnE
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Expert Comment

by:sassas081597
ID: 1346335
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
 
LVL 4

Accepted Solution

by:
erajoj earned 100 total points
ID: 1346336
Easiest way (case insensitive):

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

/// John

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question