Create a query which contains the main data you want, then
drag it into your main form; where it will appear as a
subform.
Link up the subform child fields and master fields, (using
the wizard if possible) and hey presto ! As a minimum,
you may have to put the recalc code in the Click event of
your command button, to ensure the subform refreshes as
required: