Solved

Search - find in Dbgrid

Posted on 2003-11-04
3
296 Views
Last Modified: 2010-04-05
Hi.
I want to add a code in my database application, that can search for a string like a telephone number and then the number in the dbgrid receive focus.
More specific :

I would like something like a quick search where i put a letter or 2 in an editbox and then the dbgrid scroll down to that number. For example if i write in the editbox "6" then the dbgrid shoul run down to the numbers starting with 6 etc.

A simple tip about the right command i think it would be enough.
0
Comment
Question by:CodedK
[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
3 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 35 total points
ID: 9682352
just use the locate-method of the underlying dataset
(of course partial locate woks only with stringfields)

see online help about locate

meikl ;-)
0
 
LVL 16

Author Comment

by:CodedK
ID: 9682501
Do you mean this?

Delphi syntax:

function Locate(const KeyFields: string; const KeyValues: Variant; Options: TLocateOptions
): Boolean; virtual;
0
 
LVL 16

Author Comment

by:CodedK
ID: 9682567
ok i found something about locate method thank you very much. Hope it works.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

710 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