|
Por ahi esta el problema entonces, porque no vacio la tabla, el codigo que puse mas arriba es el unico proceso que realizo para guardar en las respectivas tablas remito y remitodetalle, donde la vaciaria?
procedure TFrmRemito.BitBtn1Click(Sender: TObject);
var
numremito:real;
begin
numremito:=strtofloat(label12.Caption);
If messagedlg('Los datos del Remito con correctos?',MTwarning,mbOKCancel,0)<>
mrok
then
exit;
with dmzingueria do begin
remito.Insert;
remitonumremito.Value:=numremito;
remitoclicod.Value:=strtofloat(dbtext1.Caption);
remitofecha.Value:=strtodate(fecha);
remitofacturado.Value:=false;
remito.Post;
with mtremito do begin
first;
while not eof do begin
remitodetalle.Append;
remitodetallenumremito.Value:=numremito;
remitodetalle.FieldByName('codipro').Value:=FieldByName('codigo').value;
remitodetalle.FieldByName('cantidad').Value:=fieldbyname('cantidad').Value;
remitodetalle.FieldByName('concepto').Value:=fieldbyname('descripcion').Value;
next;
end;
end;
contadorx.Post;
end;
end;
end.
Otra cosita, esta mal como asigno el nro de remito? Cual es la forma de hacerlo correctamente extrayendo el ultimo nro de un campo, en este caso el campo se llema numremito
procedure TFrmprincipal.Remito2Click(Sender: TObject);
var
num:integer;
begin
num:=frmremito.contadorx['contremito'];
frmremito.contadorx.Insert;
frmremito.contadorx['contremito']:=num+1;
frmremito.Label12.Caption:=inttostr(frmremito.contadorxcontremito.Value);
frmremito.ShowModal
end;
end.Porque con este codigo me repite y me los ordena mal no va parejo.
Gracias por el tiempo
|