Lo podrías hacer mediante un query, aquí una función que hace los dos procesos al mismo tiempo:
Código Delphi
[-]
function GetKeyValue: string;
var
ValorAnterior: string;
ParteNumerica: Integer;
begin
with TQuery.Create(nil) do
try
SQL.Text := 'select max(campokey) from tabla'; Open;
ValorAnterior := Fields[0].AsString;
Close
finally
free
end;
ParteNumerica := StrToInt(Copy(ValorAnterior, 2, 4));
Inc(ParteNumerica);
Result := Format('A%.4d', [ParteNumerica])
end;
Saludos...