function TForm1.AddValue(ThisTable: TDataSet; const FieldName: string;
ThisValue: Variant): Boolean;
begin
Result := False;
if ThisValue = nil then Exit;
if ThisValue.IsNull then Exit;
if not Assigned(ThisTable) then
begin
Logging.Lines.Add('ERROR: Cannot add field to unassigned table!');
Exit;
end;
if ThisTable.FindField(FieldName) = nil then
begin
Logging.Lines.Add('ERROR: Field ' + Name + ' does not exist!');
Exit;
end;
ThisTable.FieldByName(FieldName).Value := ThisValue;
Result := True;
end;