Update value in subform before submit

Update value in subform before submit

Hi I want to put numeric values in a sub form and total up the values in a separate field before pressing submit.

For example i have 3 fields called Size 1, Size 2 and Size 3. a fourth field called Total of size. When i use this as a sub form i want the total to get updated as i enter a number in size 1 and than that total to get updated when i enter another number is size 2 and so on. Thanks