Vale, ahora sí lo entiendo. Puedes hacer una cosa así:
En el AfterPost (que no BeforePost) puedes hacer.....
Código Delphi
[-]
procedure TForm1.Table1AfterPost(DataSet: TDataSet);
var
Q: TQuery;
begin
Q := TQuery.Create(Selft);
Q.Database := 'la que sea';
try
Q.SQL.Text := 'select sum(Cantidad*Precunit) suma from TblDetproducto where Consumo = ' +
Table1.FieldByName('IDConsumo ').AsString;
Q.Open;
if Q.IsEmpty then
Table1.FieldByName('Totalfactu').AsFloat := 0
else
Table1.FieldByName('Totalfactu').AsFloat := Q.FieldByName('suma').AsFloat;
finally
FreeAndNil(Q);
end;
end;
Donde Table2 será tu tabla maestra
Espero que te sirva