DBGrid detail table Calc Field Totals in a master table

I want to place the totals of a DBGrid Column (detail table) into  a
DBEditField in the Master and then use this total to produce Calc field in
the DBgrid detail table.

Trouble is that ;
TdataModule2.Table2CalcFields(DataSet: TdataSet)
is executing before
TForm3.DBEdit1Change(Sender: TObject)

Hence the calculation on the calc fields in the DBGrid is incorrect. ie
using the Total from the previous Master.