Solved

Searching Combobox to see if string exists

Posted on 1997-09-26
2
139 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

744 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now