Locate a subsequent record

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

Locate a subsequent record

Post by sandy771 » Thu 28 Mar 2013 12:15

I have a grid that is connected to a UniTable that is sorted on column a. I am using Locate to find the first record in column b that starts with a given letter and move the cursor to it. This works fine

However, I want to implement a "find next" function that moves the cursor onto the next matching record. Any ideas how to go about this?

Thx

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Locate a subsequent record

Post by AlexP » Thu 28 Mar 2013 15:17

Hello,

To locate the next/previous record, you can use the LocateEx method, where you need to specify the lxNext/lxUp search direction as the last parameter:

Code: Select all

UniQuery1.LocateEx('ID',10,[lxNext]);

Post Reply