Ok Yo llamo los articulos procedentes de la tabla inventario mediante una adoquery y los inserto asi en el clientdataset
Código Delphi
[-]
procedure TVENTAS.CodigoKeyPress(Sender: TObject; var Key: Char);
var a:integer;
begin
if codigo.Text<>'' then
if key=#13 then
if Querycodigo.IsEmpty=false then
begin
codigo.Text:=Querycodigo.fieldbyname('codigo').AsString;
Detalle.Text:=Querycodigo.fieldbyname('Detalle').AsString;
Valor.Text:=Querycodigo.fieldbyname('Precio').AsString;
with CDS do
begin
Append;
FieldByname('Cantidad').AsFloat := strtofloat(cant.Text);
FieldByname('Detalle').AsString := Detalle.Text;
FieldByname('Precio').AsString := Valor.Text;
FieldByname('Codigo').AsString := codigo.Text;
Post;
asi voy insertando lienea por linea al dbgrid, la cantidad si necesito cambiarla lo hago en el dbgrid, luego grabo a la tabla ventas asi:
Código Delphi
[-]procedure TVENTAS.FACTURARClick(Sender: TObject);
begin
With ADOCONNECTION1 do
begin
Connected := True;
With ADOTABLE1 do
begin
Active := True;
CDS.ApplyUpdates(0);
Active := False;
end;
Connected := False;
cds.Close;
Estoy trabajando con tablas de access y me conecto con adoconection, adotable1, datasource1, datasetprovider1, clientdataset "CDS".Hasta aqui todo funciona bien, pero ni idea como descontar del inventario. Graciass