Topic: Little Help for..Saving new record line :)
Hello Guys,
I'm using two Grids (linked to two Tables of my database) to copy a complete line (4 columns) from Grid A to Grid B
with the following script. The results displays correctly in Grid B at first,
Now : I would like to know the WAY TO SAVE THE NEW LINE CONTENT of Grid B. ? !!
Does one have to use the SAVE ACTION on the same DEFVALUE button and place my Code on a distinct EVENT
(like before saving...) ?
..or is there another function (?) I can add at the END of my script to SAVE the changes ?
procedure Form_DEFVALUE_OnClick (Sender: string; var Cancel: boolean);
begin
Fvol.GRIDB.AddRow;
Fvol.GRIDB.selectedrow:= 0;
Fvol.GRIDB.Cells[0,0]:= Fvol.GRIDA.Cells[1,1];
Fvol.GRIDB.Cells[1,0]:= Fvol.GRIDA.Cells[2,1];
end;
..also this code works WELL overwriting an existing content (when GRID B is displaying existing records)
...but if it does not copy succesfully the content from Grid A when Grid B "loads empty" (not showing any existing records).
As a result I would get a bunch of "1" in each column.
Thanks for your advices !
I tried using
: Fvol.GRIDB.dbUpdate;
but it seems that it is NOT the right command to save the line content..