Ver Mensaje Individual
  #11  
Antiguo 20-08-2010
cloayza cloayza is offline
Miembro
 
Registrado: may 2003
Ubicación: San Pedro de la Paz, Chile
Posts: 947
Reputación: 25
cloayza Tiene un aura espectacularcloayza Tiene un aura espectacular
Yo lo haria asi...
Código Delphi [-]
{Antes de Insertar un nuevo registro me voy al ultimo
y cambio su estado a 'N'}
procedure TForm1.Camions_AuxBeforeInsert(DataSet: TDataSet);
begin
     Camions_Aux.Last;
     Camions_Aux.Edit;
     Camions_AuxACTUAL.Value:= 'N';
     Camions_Aux.Post;
end;

{Si se cancelo la accion de insertar, restauro el valor del ultimo registro
a 'S'}
procedure TForm1.Camions_AuxAfterCancel(DataSet: TDataSet);
begin
      {Esto solo se debe hacer cuando Dataset.State=dsInsert} 
      if DataSet.State <> dsInsert then Exit;     

      Camions_Aux.last;
     Camions_Aux.Edit;
     Camions_AuxACTUAL.Value:= 'S';
     Camions_Aux.Post;
end;

{Para un nuevo registro le asigno el valor por defecto 'S'}
procedure TForm1.Camions_AuxNewRecord(DataSet: TDataSet);
begin
     Camions_AuxACTUAL.Value:= 'S';
end;

Espero te sirva...
Responder Con Cita