Hi all,
I'm trying to run through a set of about 7000 records to calculate then store a piece of data but I can't seem to actually move through the records. Everything works absolutely perfectly for one record at a time, but then never moves on to the next record. This should be simple right? Thanks for any help
Code:
Private Sub cmdWDIH_Click()
Dim db As DAO.Database
Dim mainrs As DAO.Recordset
Set db = CurrentDb
Set mainrs = db.OpenRecordset("MainQuery")
Do Until mainrs.EOF = True
If (Not IsNull(txtSumShipDate.Value) And Not IsNull(txtSumPromiseDate.Value)) Then
Me!WorkDaysInHouse = CalcWorkdays([ReceiveDate], [ShipDate])
txtSumShipDays.Value = WorkDaysInHouse
If (WorkDaysInHouse <= 2) Then
txtSumOnTime.Value = "Yes"
Else
txtSumOnTime.Value = "No"
End If
Me!ShipFY = getFY([ShipDate])
Me!ShipPeriod = getPeriod([ShipDate])
End If
mainrs.MoveNext
Loop
MsgBox "Finished"
mainrs.Close
End Sub