if sales <> 0 and payments<> 0 then look at the previous records balance to get the 'beginning balance'