Ver Mensaje Individual
  #3  
Antiguo 19-08-2010
Avatar de jafera
jafera jafera is offline
Miembro
 
Registrado: may 2007
Ubicación: Llagostera (Girona)
Posts: 585
Reputación: 20
jafera Va por buen camino
Buenas ecfisa, a ver si lo he entendidobien, yo coloco el codigo aqui, lo he insertado en el código que ya tenia yo puesto en el evento

Código Delphi [-]
 
procedure TF_ModulDades.Camions_AuxAfterPost(DataSet: TDataSet);
var Pos:TBookmark;
begin
        Pos := Camions_Aux.GetBookmark;
        IBTBombers.CommitRetaining;
        Camions_Aux.Close;
        Camions_Aux.Open;
        Camions_Aux.GotoBookmark(Pos);
        with Camions_Aux do
        begin
                Prior;
                Edit;
                Camions_AuxACTUAL.Value:= 'N';
                Post;
        end;
        Camions_Aux.FreeBookmark(Pos);
end;

El resultado es que hace el cambio a "N" pero entra en un bucle sin fin que tengo que cancelar

Que es lo que hago mal?

En el before post tengo esto

Código Delphi [-]
procedure TF_ModulDades.Camions_AuxBeforePost(DataSet: TDataSet);
begin
        If Camions_Aux.State in [dsInsert] then
        begin
                Actual_S.Close;
                Actual_S.ParamByName('ID_CAMIO').AsInteger := F_ModulDades.Camions_AuxID_CAMIO.Value;
                Actual_S.ParamByName('ID').AsInteger:=F_ModulDades.Camions_AuxID.Value;
                Actual_S.Open;
                if Actual_S.RecordCount > 0 then
                begin
                        ShowMessage('Només es pot asignar el camió a un parc');

                        //Camions_AuxACTUAL.Value := 'N';
                end;
        end;
end;

Gracias

Josep
Responder Con Cita