Solved Looping Through a Recordset Until RecordCount = ?

pooldead

Registered User.
Local time
Today, 10:26
Joined
Sep 4, 2019
Messages
136
I have some code that is creating Outlook emails. Due to the large size of the process, I want to split this out into a few steps. My goal was to run the following:

For i = 0 To rs1.recordcount = 50
<do stuff>
Next i

I tried with a Do Until rs1.recordcount = 50 as well, but both of these options just loop until the process times out. How can I tell it to stop at a certain record number?
 
Hi. Just do it like so:

For i = 0 To 50
<do stuff>
Next i
 
Hi. Just do it like so:

For i = 0 To 50
<do stuff>
Next i
So simple, probably why I missed it. I have a habit of making things harder than necessary. That did the trick, thank you!
 
So simple, probably why I missed it. I have a habit of making things harder than necessary. That did the trick, thank you!
Hi. You're welcome. Glad we could assist. Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom