Subject Re: Cannot locate a record
From Akshat Kapoor <akshat.kapoor@kapoorsons.in>
Date Thu, 22 Mar 2018 23:14:51 +0530
Newsgroups dbase.getting-started

On 22/03/2018 20:05, Pieter van Heerden wrote:
> dbase 10 on Windows 10 on a 64-bit laptop.
>
> I am trying to locate weather station INDS00003 in a weather station data table with about 5500 records.   The weather station is in the table and can be found from the tables menu system find function.  However, when setting up a code to find the station in the table, it does not find the station.  The following code is used:
>
> ? _app.stationid, form.rowset.fields["stationid"].value
> form.rowset.applylocate("StationID = '" + _app.stationid + "'")
> ? _app.stationid, form.rowset.fields["stationid"].value
>  
> The print lines are there to follow results in order to try and solve the problem.  The printed results arre:
>
> INDS00003 AFGC00021 (Quite correct)
> INDS00003  (The table value was not found - at endoffile position)
>
> The applyLocate line results in a run-through of the table without finding the record to the EndOfFile  position.
>
> I have tried changing the LocateOptions to 3, with no luck.

IF and only IF you are using .dbf tables you could go in for findkey()
an indexed search.It is much faster and accurate

Regards
Akshat