Using your 3 record example, the following works for me:
Code:
Dim rs As DAO.Recordset
Dim strType As String
Dim dblBal As Double
Set rs = CurrentDb.OpenRecordset("Select * from Company where companyid = 65 Order by companyType, employeeid;")
If Not (rs.EOF And rs.BOF) Then
rs.MoveFirst
strType = rs!companyType
Do Until rs.EOF
If strType <> rs!companyType Then
dblBal = 0
strType = rs!companyType
End If
dblBal = dblBal + Nz(rs!Add, 0) - Nz(rs!Used, 0)
rs.Edit
rs!Balance = dblBal
rs.Update
rs.MoveNext
Loop
Else
MsgBox "No records in recordset"
End If
rs.Close
Set rs = Nothing
Still recommend you just do this calculation in report and not save to table.