Ver Mensaje Individual
  #4  
Antiguo 17-11-2007
Avatar de The_Duke
The_Duke The_Duke is offline
Miembro
 
Registrado: abr 2006
Ubicación: Republica Dominicana
Posts: 48
Reputación: 0
The_Duke Va por buen camino
Smile

lo solucione de esta forma y sale bien
Código Delphi [-]
With Form1 do begin
With ADOQuery1 do begin
 if active then close;
 SQL.Clear;
 SQL.Add('Select I.Cod_med, I.Fecha, I.Cod_pac, I.cod_ind'); //todos los campos que necesitas de Indicaciones
 SQL.Add('From Indicaciones I');
 SQL.Add('where I.cod_ind = :CodigoIndicacion');
 Parameters.ParamByName('CodigoIndicacion').Value := DBEdit2.Text;
 Open;
end;
With ADOQuery2 do begin
 if active then close;
 SQL.Clear;
 SQL.Add('Select M.Cod_medi, M.cantidad, M.dosis'); //todos los campos que necesitas de Indicaciones
 SQL.Add('From IM M');
 SQL.Add('where M.cod_ind = :CodigoIndicacion');
 Parameters.ParamByName('CodigoIndicacion').Value := DBEdit2.Text;
 Open;
end;
Form1.QuickRep1.Preview;
end;
sobre esto:
Código Delphi [-]
Data.Tindicaciones.edit; // edito porque andes de guardar puede que de error y asi me lo evito
Data.Tindicaciones.post; // graba la tabla con lo datos que se le introdujo
y esto
Form1.QuickRep1.Preview; // indico que el qreport esta en ese formulario que seria igual a:
With Form1 do begin
 QuickRep1.Preview;
end;
Gracias por ayudarme
Responder Con Cita