Solved

Search - find in Dbgrid

Posted on 2003-11-04
3
286 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
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 35 total points
Comment Utility
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
Comment Utility
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
Comment Utility
ok i found something about locate method thank you very much. Hope it works.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

16 Experts available now in Live!

Get 1:1 Help Now