DBAdvEdit.FloatValue and OnExit

Hi

Please put a form 2 DBAdvEdit.

Set the datasource possible to edit.

Set the DBAdvEdit_1.OnExit:
DBAdvEdit_2.FloatValue:=DBAdvEdit_2.FloatValue*2;

Run.
If exit from DBAdvEdit_1 the first time, the DBAdvEdit_2.FloatValue not changed.
The next time and later all ok.

Only the first time the second DBAdvEdit_2, whereto arrive the focus, the value don't changed.


Thanks in advance.

WIN 7, Delphi XE, TMS CP 7.0.3.0

The problem exists in TMS CP 7.0.4.0 too.

Again:
In first time, when exit from DBAdvEdit1 (TAB), and run the DBAdvEdit1.OnExit, the DBAdvEdit2.FloatValue not changed.
When again TAB, TAB, in the second and others cases, the DBAdvEdit2.FloatValue change normal.

I am unable to reproduce this.
In your first code snippet, you also mention DBAdvEdit_1.OnExit but don't use DBAdvEdit_1.OnExit, but instead DBAdvEdit_2.OnExit




First exit from DBAdvEdit1 (TAB).

Second exit from DBAdvEdit1 (TAB + TAB)

unit Unit5;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, IBCustomDataSet, StdCtrls, AdvEdit, DBAdvEd, IBDatabase;

type
  TForm5 = class(TForm)
    IBDatabase1: TIBDatabase;
    IBTransaction1: TIBTransaction;
    DataSource1: TDataSource;
    DBAdvEdit1: TDBAdvEdit;
    DBAdvEdit2: TDBAdvEdit;
    IBDataSet1: TIBDataSet;
    Memo1: TMemo;
    procedure FormShow(Sender: TObject);
    procedure DBAdvEdit1Exit(Sender: TObject);
    procedure DBAdvEdit2Enter(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form5: TForm5;

implementation

{$R .dfm}

procedure TForm5.DBAdvEdit1Exit(Sender: TObject);
begin
  Memo1.Lines.Add('DBAdvEdit1Exit');
  DBAdvEdit2.FloatValue:=DBAdvEdit2.FloatValue
2;
  Memo1.Lines.Add(floattostr(DBAdvEdit2.FloatValue));
end;

procedure TForm5.DBAdvEdit2Enter(Sender: TObject);
begin
  Memo1.Lines.Add('DBAdvEdit2Enter');
  Memo1.Lines.Add(floattostr(DBAdvEdit2.FloatValue));
end;

procedure TForm5.FormShow(Sender: TObject);
begin
  IBDatabase1.Connected:=true;
  IBDataSet1.Open;
  IBDataSet1.Edit;
end;

end.

Only 1 OnExit exists.

I change the DBAdvEdit.FloatValue. It's work, but the value again changed.
See picture 1.
In DBAdvEdit1Exit the value=18374, but in 

DBAdvEdit2Enter already 9187 again.

Its work wrong ony the first time.
Next fork perfect, see picture 2

The issue should be fixed in the next update.

The problem exists in TMS CP 7.1.0.0.

I investigated the problem here again and I suspect there was a misunderstanding of your problem description. If you expect that the dataset value will be updated by setting DBAdvEdit.FloatValue, that is not the case and that will not happen. That is consistent with how a TDBEdit work also. When you update a TDBEdit.Text, it will not update the dataset, hence, when you will enter the TDBEdit, it will show the dataset text that is unchanged. If you want to update the value, you should update it directly in the dataset.