Hello sibprogsistem
Below, how I realize what you want to get :
procedure Saisie_Button3_OnAfterClick (Sender: TObject);
begin
Form1.TableGrid1.dbItemID := Last_Insert_Id(); // On se positionne sur le dernier enregistrement saisi
Form1.TableGrid1.dbUpdate;
end;
In the segment Last_Insert, don't place any parameters between()
Or you can place this in th evement OnChange of your TableGrid :
if PrevAction = 'NewRecord' then
begin
PrevAction := '';
Form1.TableGrid1.dbUpdate;
Form1.TableGrid1.dbItemID := Last_Insert_id;
Form1.TableGrid1.ScrollToRow(Form1.TableGrid1.SelectedRow);
Form1.TableGrid1.SetFocus;
end;
In this case, don't forget to declare this global variable :
var PrevAction: string;
But don't use the those two pieces of code in the same time
Can this help you ?
JB