R
ridlt
Hi - My first post - What a great website
I'm having problems with the Do loop below - I can't get it to execute
I need the loop to re-calc balances. What is it that i'm doing wrong.
Thanks for any help - Tom
------------------------------------------------------------------------------
----------
Private Sub cmdCalc_Click()
'Recalc Balances
Dim douBegBal As Double
Dim douEndBal As Double
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("tblContingency")
rst.MoveFirst
douEndBal = BegBalance
Do Until rst.EOF
BegBalance = douEndBal
EndBalance = BegBalance + Additions + Reductions
douEndBal = EndBalance
'rst.MoveNext
Loop
rst.Close
Set rst = Nothing
Set db = Nothing
End Sub
I'm having problems with the Do loop below - I can't get it to execute
I need the loop to re-calc balances. What is it that i'm doing wrong.
Thanks for any help - Tom
------------------------------------------------------------------------------
----------
Private Sub cmdCalc_Click()
'Recalc Balances
Dim douBegBal As Double
Dim douEndBal As Double
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("tblContingency")
rst.MoveFirst
douEndBal = BegBalance
Do Until rst.EOF
BegBalance = douEndBal
EndBalance = BegBalance + Additions + Reductions
douEndBal = EndBalance
'rst.MoveNext
Loop
rst.Close
Set rst = Nothing
Set db = Nothing
End Sub