Subject Re: [IBO] Problem again with OnDataChange
Author Jason Wharton
Kevin,

> Then how in the heck to I detect the customer number changing? The code I
> posted in the original email came from Jason quite some time ago.
>
> I don't want to do the code (set field values, etc) every time the event
> fires (Field.FieldName - nil), I only want to change fields in the record
> when the user changes the customer number. How can I do this?
>
> It works perfectly w/ an IB_Edit but not w/ a TIB_LookupCombo. My
personal
> opinion is the TIB_LookupCombo is not functioning properly.
>
> There has to be a way to capture when a field value changes. Forever it
has
> been in the OnDataChange event, testing Field.FieldName for the
appropriate
> field.
>
> What is the correct way now?

The way I would have done it in the first place is to maintain a current
version in a local variable to the data module or form. Then, in the
OnDataChange event I would compare the current value in the data with the
current stored value. If there is a difference then you have your culprit.

You would just have to tell the difference between a record being scrolled
or an actual change. This should be as simple as whether the dataset is in
an edit state or not.

HTH,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com