Hola Niiña.
No sé con que componentes estés trabajando pero podés hacer todo utilizando sólamente el query:
Código Delphi
[-]
with IBQuery do
begin
Close;
SQL.Clear;
SQL.Add('SELECT MAX(ID_TABLA)+1 FROM TABLA1');
Open;
Edit1.Text:= IntToStr(Query.Fields[0].AsInteger);
Close;
SQL.Clear;
SQL.Add('INSERT INTO TABLA1 (ID_TABLA, NOMBRETABLA) ');
SQL.Add('VALUES (:ID, :NOMBRE)');
ParamByName('ID').AsString:= Edit1.Text;
ParamByName('NOMBRE').AsString:= Edit2nombre.Text;
ExecSQL;
end;
IBTransaction.Commit;
Un saludo.