DbGrid or TSQLQuery best option lazarus / 16-Databases ---------------------------------------------------------------------- eldonfsr · 2025-03-05 14:42 Hi i have a problem do you know when we have dbgrid user can go down or up how can know when he move to next record or select record to update a tabcontrol where is locate dbgrid...filter record on another table... afterscroll or beforescroll , datasource  or  ondatachange Thanks ---------------------------------------------------------------------- TRon · 2025-03-05 15:02 Based on the description, though I have to guess a bit, you are probably referring to a master-detail solution. See also our wiki where the concept is explained and an example provided. Here is another example (though it is quite old and I do not know if it still builds). ---------------------------------------------------------------------- egsuh · 2025-03-06 04:10 In addition to TRon's comment, you should focus on 'TDataSet descendants', e.g. TSQLQuery, not TDBGrid. What DBGrid does is to show the state of TDataSet. Filtering, etc. should be done on TDataSet descendants. ---------------------------------------------------------------------- wcage03 · 2025-03-18 18:32 The DBGrid will show you visually which row you are on in the dataset. The SQLQuery will actually be tracking to the specific row. You can do something like SQLQuery1.FieldByName('SomeField').AsString (or AsInteger, etc.) to grab the value of a field on the row that the DBGrid shows as selected. The DBGrid does a lot of additional things, but one thing it does is act sort of like a navigator within the dataset.