TQRDBRichEdit in a SubDetail Band

Hi?

I'd like to know if this is possible and if this is not the right
group to ask i'd like to know either:

In a QuickReport i would like to print in this way:

I have a "master" table that i print in the detail band and in this
table there is a field with the name of a table where i'm going to
take a blob field to be printed in a TQRDBRichEdit in a subdetail
band, but before print the detailband i put this code:

procedure TFRepHis.DetailBand1BeforePrint(Sender: TQRCustomBand;
  var PrintBand: Boolean);
begin
  With FHisEst.QEstudi do begin  // query linked to the QReport and
DetailBand
    Q.Close;                     // query linked to the subdetailband
    Q.SQL.Clear;
    If FieldByName('ESTUDI').AsString = 'CONSULTA' then
      Q.SQL.Add('Select impre1 from CONSULTA where NUMEST =:NUMEST');

    If FieldByName('ESTUDI').AsString = 'ULTRASONIDO' then
      Q.SQL.Add('Select impre1 from ULTRASON where NUMEST =:NUMEST');

    If FieldByName('ESTUDI').AsString = 'FLUORANGIOGRAFIA' then
      Q.SQL.Add('Select impre1 from FLUORANG where NUMEST =:NUMEST');

    If FieldByName('ESTUDI').AsString = 'LASSER YAG' then
      Q.SQL.Add('Select impre1 from LASSERYA where NUMEST =:NUMEST');

    If FieldByName('ESTUDI').AsString = 'LASSER ARGON' then
      Q.SQL.Add('Select impre1 from LASSERAR where NUMEST =:NUMEST');

    If FieldByName('ESTUDI').AsString = 'CAMPOS VISUALES' then
      Q.SQL.Add('Select impre1 from CAMPOSVI where NUMEST =:NUMEST');

    If FieldByName('ESTUDI').AsString = 'OTROS ESTUDIOS' then
      Q.SQL.Add('Select impre1 from OTROSEST where NUMEST =:NUMEST');

    //subdetail.numest = master.numest
    Q.ParamByName('NUMEST').AsFloat := FieldByName('NUMEST').AsFloat;
    {Q.Prepare;}
    Q.Open;
    Application.ProcessMessages;
  end;
end;

FHisEst.QEstudi is the query linked to the QReport and the detailband
Q is the Query linked to the subdetailband, The TQRDBRichEdit it
dataset is Q and the it field is IMPRE1, But this doesnt print
anything in the TQRDBRichEdit.

If i execute the Query.prepare line when it's going to be printed the
detailband an error ocures. I don't know if i can change the sql
statement at runtime to print a the blob field in the report, or if i
have to reasign the dataset of the TQRDBRichEdit and the field after i
execute the query or if is there a better way to do this or more
better, that it works i will apreciate because i don't know what to do

thanx in advance