Sorting records after insert lazarus / 16-Databases ---------------------------------------------------------------------- daveinhull · 2017-09-18 21:08 Hi, Just wondering if someone could help with what is probably a very simple issue. I'm using the TDBNavigator to add a new record and it works OK except that the record is the first in the Form list until I exit and restart. I was looking for some On Event which I could use once it has been added to do a query refresh, but the query after insert seems to go of when the new record becomes available rather than when I press the tick (accept) in the Navigator. Any help or a reference to look at would be much appreciated. Thanks Dave ---------------------------------------------------------------------- taazz · 2017-09-18 21:23 use after post ---------------------------------------------------------------------- daveinhull · 2017-09-19 08:45 Hi taazz, Yes I'd thought of that but if I do something like .Refresh after post then it will refresh whenever I do an edit to a EditBox and this pushes the current record back to the start. I suppose I could save the record position, .Refresh and then restore the record position, but was hoping there was something else I could do a bit neater. Thanks ---------------------------------------------------------------------- taazz · 2017-09-19 09:19 what you are describing is server side indices. If you want client side indices then in delphi you had to use a clientdataset and its index properties (eg indexfieldname). SqlQuery seems to be based on tbuffdataset which has the indexfieldnames property included try to use that instead. be forwarned I have never done that in lazarus so I'm not a good point of reference.