Ver Mensaje Individual
  #2  
Antiguo 18-05-2006
Avatar de judit25
judit25 judit25 is offline
Miembro
 
Registrado: abr 2006
Ubicación: Bronx, NY
Posts: 122
Reputación: 19
judit25 Va por buen camino
Abundando un poco más (esto me funciona menos en el último registro)

Estoy empleando este código en el evento BeforeApplyUpdates de CDS2 (que es el clientDataSet del detalle), pero a la hora de grabar me actualiza en la tabla Inventario todos los registros menos el último.
Código Delphi [-]
CDS2.First;
while not CDS2.Eof do
  begin
        if DM.TInventario.Locate('Cod_prod', CDS2Cod_Prod.Value, []) then
           begin
              DM.TInventario.Edit;
              DM.TInventarioCant_Salida.Value := DM.TInventarioCant_Salida.Value + CDS2Cantidad.Value;
              DM.TInventarioCant_Actual.Value := DM.TInventarioCant_Actual.Value - CDS2Cantidad.Value;
              DM.TInventario.UpdateRecord;
           end;
        CDS2.Next;
  end;
Alguna idea de que me hace falta para que funcione en todos los registros?

Gracias anticipadas

Saludos

Y disculpen las molestias

Última edición por judit25 fecha: 24-05-2006 a las 22:00:51.
Responder Con Cita