Assuming you are summing on a continuous form (i.e) many records, and you don't filter the recordset, you can put an unbound field in the Footer or Header of the form, and use
DSum(...) for the records on this form, then you may have to update it if it doesn't role.
You can always just put the IIf in the query behind the form, QBF,and then use Sum(Expression) and then just try to use Sum(something). Then you have to query.
A little tricky but possible. Need to make sure you get what you want.
Just do one step at a time, to make sure the formula works.
Reports are much easier, they have rolling sums.