Hola
Tal vez mysql no acepta max(), trata de usar Last(), asi:
Código Delphi
[-]
If combobox1.text = 'Entrada' then
begin
A:= 'E';
end
else begin
A:= 'S';
end;
query.Close;
query.SQL.Text:='SELECT Last(folio) FROM entradas where tipo = '''+ A + '*'' ';
query.Open;
folio.text := IntToStr(query.FieldByName('folio').asInteger +1) ;
Saludos