I haven’t had much practice with Loop statements and have exhausted my resources. I have a form that runs an append query beginning with record 1 and runs until record X is reached. The form is refreshed after each record is reviewed and I’m trying to use a loop function to run the iterations from record 1 until reocrd X is reached. Here is the code I’m using:
Private Sub cmdMakeInvoices_Click()
Do
Do While Me.intRecordNum Me.intRecordMax Then ‘ If condition is True.
Exit Do ‘ Exit inner loop.
End If
Loop
Loop Until Me.intRecordNum <= Me.intRecordMax
End Sub
intRecordNum is the current record and intRecordMax is the last record to run. The me.Requery refreshes the form as the form source only pulls one record at a time. My problem with the statement above is it doesn't stop when intRecordNum is greater than intRecordMax. I'm sure there's some silly code I omitted.
Thanks!