procedure TModificacion.PngSpeedButton2Click(Sender: TObject);
begin
if trim(edit1.Text)<>'' then begin
with dm1.Q_Cproductos do
begin
active:=false;
sql.Clear;
sql.add('select P.Codigo, P.Producto, .... etc'); SQL.Add('from C_productos P'); sql.add('where P.codigo like :Codigo');
Parameters.ParamByName('Codigo').AsString := edit1.Text;
active:=true;
if recordcount=0 then
messagedlg('No se encontro el producto a modificar, intente de nuevo',mtinformation,[mbok],0);
begin
edit2.Text:=fieldbyname('producto').asstring;
edit3.Text:=fieldbyname('codigo').asstring;
edit4.Text:=fieldbyname('cantidad_unidad').asstring;
edit5.text:=fieldbyname('precio_unidad').asstring;
edit6.Text:=fieldbyname('unidad_existencia').asstring;
dtp1.DateTime:=fieldbyname('fecha_alta').asdatetime;
combobox1.Text:=fieldbyname('Compañia').asstring;
combobox2.Text:=fieldbyname('categoria').asstring;
image2.Picture.LoadFromFile(fieldbyname('foto').asstring);
end;
end;
end;
end;