Subject Re: [IBO] TIB_LookupCombo Problem
Author Helen Borrie (TeamIBO)
At 11:46 PM 18-02-02 +1100, you wrote:

> I've been trying to figure out how to code-up the OnAfterModify event
>to no avail. Can you point me in the right direction in terms of any
>documentation on this.

Err..Sorry to be too quick on the draw..I don't think there's a straightforward way to get at this event.

Look at the properties of TIB_Column object, focus on its Row property and follow that up by studying the properties and methods of TIB_Row. Note especially the Row.ByName() method, which is a very natty and safe way to access the other fields.

Each member of the Fields[] array is a TIB_Column.

Catch the change in the OnDataChange event of the TIB_Datasource that points to the parent. That's where the processing takes place to transfer any changes from the control to the dataset:

procedure TForm1.IB_DataSource1DataChange(Sender: TIB_StatementLink;
Statement: TIB_Statement; Field: TIB_Column);
begin
if IB_DataSource1.RowState = rsModified then
if Field.OldAsString <> Field.AsString then
begin
Field.Row.ByName('AnotherCol').Value := <whatever you like>;
...
end
else
begin
<handle what you want to happen if the other cols don't match
their original values, which would indicate the user changed
his mind and reverted Field to its original value>
end;
inherited;
end;

Geoff plays around with datasources a lot and probably has some good input to add for you on this particular task...


regards,
Helen Borrie (TeamIBO Support)

** Please don't email your support questions privately **
Ask on the list and everyone benefits
Don't forget the IB Objects online FAQ - link from any page at www.ibobjects.com