I can't really help you with the code here because I've only ever used a report's on format event to run procedures. It seems to me that this report is going to be a standard one, so I don't think there is any need for coding.
In your first footer which I think is Machine, add a text box or 2 text boxes, one upon another if you want both running sum over group totals and running sum over all totals, put your formula in the control source, which should be =SUM([Field1])-SUM([Field2])(type the field names as they appear in the table, query or recordset. In the running sum property, select over group or over all. Then just copy the control(s) to each of the other footers. There's really no need to name the controls in the standard way as I don't believe any coding will ne necessary. As long as you've done your sorting and grouping properly your figures should come out just fine.
If I've misread what you want to do or this doesn't work, post the exact names of the fields you want to use and a list of records, in order of the grouping, e.g. Machine, Shift, Day.
Regards
Bill