Home All Groups Group Topic Archive Search About
Author
2 Aug 2006 1:55 AM
Goldie
Can anyone offer advice on how to do a nested loop with vb

I need the loop nested in the main loop to be passed a variable from
the parent loop for SQL purposes.

eg:
parent selects all customer_id's and other information

child loop needs the customer_id to do SELECT * FROM table WHERE
customer_id = '@from_parent_loop'


I hope this makes sense, and i'm sure it's pretty simple, but my mind
is fogged at the moment

Author
2 Aug 2006 1:48 PM
Chris Dunaway
Goldie wrote:
> Can anyone offer advice on how to do a nested loop with vb
>
> I need the loop nested in the main loop to be passed a variable from
> the parent loop for SQL purposes.
>

Perhaps a For Each?

For Each id As Integer In Container
    'Use the id here in the SELECT query
Next