G
Guest
Hi,
I am trying to run "DO LOOPS" within a "DO LOOP" also called nested loops,
but I see that somehow only the last do loop within the tree works.
See the code below:
Do Until rst2.EOF
Do Until rst3.EOF
Do Until rst1.EOF
''execute code here for every record in rst1,
''but for every record in rst3. Every record
''in rst3 has one or more records in rst1
rst1.MoveNext
Loop
rst3.MoveNext
Loop
rst2.MoveNext
Loop
I see that only the code for the first record in rst3 is being executed, but
rst3 has more than 3 records. What should I do so that the code is being
executed for every record in rst1, belonging to a record in rst3?
You can see it as a parent-child realtionship, where rst3 is the parent and
rst1 is the child.
Thanks.
I am trying to run "DO LOOPS" within a "DO LOOP" also called nested loops,
but I see that somehow only the last do loop within the tree works.
See the code below:
Do Until rst2.EOF
Do Until rst3.EOF
Do Until rst1.EOF
''execute code here for every record in rst1,
''but for every record in rst3. Every record
''in rst3 has one or more records in rst1
rst1.MoveNext
Loop
rst3.MoveNext
Loop
rst2.MoveNext
Loop
I see that only the code for the first record in rst3 is being executed, but
rst3 has more than 3 records. What should I do so that the code is being
executed for every record in rst1, belonging to a record in rst3?
You can see it as a parent-child realtionship, where rst3 is the parent and
rst1 is the child.
Thanks.