Filter using two text fields?

Posted on 1998-09-26
Last Modified: 2010-04-06
I need to be able to filter a table based on information taken from two edit.text boxes. How do I do this?
Mike Ross
Question by:mykyl
1 Comment

Accepted Solution

333 earned 50 total points
ID: 1340886
Use TQuery, not TTable.

i.e if Query1 is TQuery, then

procedure Form1.Button1Click(Sender:TObject);
  if Query1.Active then Query1.Close;
  Query1.Sql.Add('select * from MyTable where Field1="'+Edit1.Text+'" and Field2="'+Edit2.Text+'"');


Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In a recent question ( here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

810 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