Hi.
I need to loop through a table choosing records and moving them to another table. I have over 250,00 rows and doing the whole table at once chokes the app. I've decided to loop through and break the data down into smaller bites.
What I need to do is have a loop inside a loop. The internal loop (after the FOR statement below) needs to be repeated 13 times and the external loop needs to be repeated until a table called tblRouteList has no more null values in the field "Done".
Please see the code below. I tried doing this with macros calling each other but it bails out after 10 cycles with error 2525.
Thanks in advance
Function mcrResetNextRoute()
On Error GoTo mcrResetNextRoute_Err
DoCmd.OpenQuery "qryTruncateService_Location", acViewNormal, acEdit
DoCmd.OpenQuery "qryUpdateDoneRoute", acViewNormal, acEdit
DoCmd.OpenQuery "qryTruncatetblNextRoute", acViewNormal, acEdit
DoCmd.OpenQuery "qryAppendNextRoute", acViewNormal, acEdit
DoCmd.OpenQuery "qryAppendtoService_Location", acViewNormal, acEdit
DoCmd.OpenQuery "qryResetPhaseNumber", acViewNormal, acEdit
For i = 1 To 13
DoCmd.OpenQuery "qryAppendTotblPhases", acViewNormal, acEdit
DoCmd.OpenQuery "qryUpdateDelDate", acViewNormal, acEdit
DoCmd.OpenQuery "qryDeleteRecords", acViewNormal, acEdit
DoCmd.OpenQuery "qryUpdatePhase", acViewNormal, acEdit
DoCmd.OpenQuery "qryIncrementPhaseNumber", acViewNormal, acEdit
Next i
mcrResetNextRoute_Exit:
Exit Function
mcrResetNextRoute_Err:
MsgBox Error$
Resume mcrResetNextRoute_Exit
End Function