mira probe lo que me dices,puse lo siguiente
Código Delphi
[-]with dm.ADOfactura do
begin
close;
parameters.ParamByName('variable').Value:= variable ;
open;
if IsEmpty then
begin
ShowMessage('Registro no existe...');
exit;
end;
end;
rptfactura.quickrep1.preview;
rptfactura.close;
y todavia me dice que variable esta sin declarar