Quantcast
Channel: Access for Developers forum
Viewing all articles
Browse latest Browse all 14673

Loop keeps repeating first record

$
0
0

The following code calculates the first record but does not move on to the next record. What am I doing wrong?

Private Sub btnCalculate_Click()
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb()
Set rst = db.OpenRecordset("Section7_2")
rst.MoveFirst
Do Until rst.EOF
    Me.TotalAcreage.Value = ((Nz(Me.CurrentAcreage) + Nz(Me.Additions) + Nz(Me.Redesignation)) - Nz(Me.Deletions))
rst.MoveNext
Loop
rst.Close
End Sub


jim neal


Viewing all articles
Browse latest Browse all 14673

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>