Dataset navigation lazarus / 16-Databases ---------------------------------------------------------------------- TRNelson · 2016-02-06 17:14 I am writing a simple program that allows the user to navigate a table and display the records one at a time.  It is simple to move one record at a time or to the front or end of the dataset.  I use the SQL command 'SELECT * FROM table_name' to load the information.  I would like to add a search function. On the surface, this seems very easy using Select Where combo.  However, that does not do what I want. I would like to have the internal record pointer of the original dataset moved to the resulting found record.  When I execute the Select Where I loose the original dataset.  It is easy to generate it again but I have now idea where the found record is. I could code search of course but that is inelegant and resource intensive. ---------------------------------------------------------------------- Jurassic Pork · 2016-02-06 18:25 hello, you can use the locate function of the TSQLQuery component :  Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function TSQLQuery.Locate(  const KeyFields: string;  const KeyValues: Variant;  Options: TLocateOptions):Boolean; virtual; example (in my database example image_mushrooms) : Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  SQLQuery1.Locate('Common_Name','Death',[loPartialKey]); on the form, in the DbGrid component, the selected record is the one which has the field Common_Name beginning with Death Friendly, J.P ---------------------------------------------------------------------- TRNelson · 2016-02-06 19:52 Yes, that works brilliantly!  I actually tried using Locate before but I did not set the Options properly. Excellent!  Thank you!