| It would help if you told us what platform you are working in. The code appears to be Access VBA. So I'll answer for that.
First you don't actually need any code to do this. If you set the ControlSource of the No3 Control to:
=IIF([Type] = "Output",([No1]*-1)*[No2],[No1]*[No2])
That will do what you want.
Second, As a general rule we do NOT store calculated values. Therefore to sum the results, you need to use a query. In Query Design mode add your table and add the three fields (Type, No1, No2). Then add a 4th column with the expression:
No3: IIF([Type] = "Output",([No1]*-1)*[No2],[No1]*[No2])
Now on your form, add unbound controls with a ControlSource of:
=DSUM("[No3]","Queryname","[Type] = 'Output'")
=DSUM("[No3]","Queryname","[Type] = 'Input'") |