?
Solved

Searching Combobox to see if string exists

Posted on 1997-09-26
2
Medium Priority
?
147 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 400 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

765 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