Return to the front of a loop.

P

PJFry

I have a block of code that loops through two recordsets and performs
updates. The first recordset compares data to the second recordset. There
are times when the second recordset reaches EOF before the first does. To
capture that event, I do a Dlookup to determine if any data remains in the
table that will fill the second recordset. If no data exists, I want to
return to the top of the loop to select data for a new first and second
recordset.


Here is a high level look:

Do Until rs.EOF
If IsNull(DLookup("exp_item_cd","tTags","exp_item_cd Is Not Null AND
merchant_cd = '" & curMer & "'")) Then
*Start over at the top of the loop*
End if

Assuming that the DLookup is not null, the loop continues here.
Loop


How can I do this?

Thanks!

PJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top