Edit field on a form displaying data from another table

I have two tables Table1 and Table2 and in both the tables there is a field “Field1” common to them.
There is a form Form2 with the datasource as Table2 having the grid displaying the records of Table2.
Now my requirement is I have to add a display/edit field in this Grid which should display the value from one of the field of Table1 (Not Field1) .If I modify the value of this display/edit field in this form2 this should also update back in Table1.

I tried using the edit method but could not get it done.

Can any one pls help me on this , where should I write the edit method and how to call it?
If possible can anyone provide me the code for it

Any suggestion on this please ?

You can write the code for updating the field of Table1 while modifying the value on the Form2.For this purpose you can override the modified() method on the form control of Form2.

Am using the display/edit field , so I couldnot use override modified.

can u help me with the code for achieving the above requirement ?

hi,

use this coe in form datasource

table1.field=table2.field;

regards

dhinu.v