Nested Loop

  • Thread starter Thread starter Goldie
  • Start date Start date
G

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
 
Goldie said:
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
 
Back
Top