Ok, so I have to loop through a table multiple times in one master loop. I'm outputting a BOM from a part table and you have a part field (parent part number) and a material part number (current material Part). The material part can also be in the part field if it has sub-parts of its own and so on and so on. So I'm just wondering how I would loop the same table multiple times. Don't need anything too complex (although if you could give me perfomance pointers that would be great too). I just need the basic idea.
Logic - Should be dynamic so I'm guessing a Do Loop may suffice and just use a boolean to flag whether there are more subs or not, but I havn't figure that out yet and is not a big concern right now. I'm more interested in the looping structure.
Loop through table for parent part numbers
get Material part number and loop through Part table to get sub-parts of current sub-part.
If records, then loop through them and continue on looping again until there are no more loops
End.
End.
BOM Structure
Parent Part
Sub Part 1
Sub Sub Part 1
Sub Sub Part 2
Sub Sub Part 3
Sub Part 2
Sub Sub Part 1
Sub Sub Part 2
........
Logic - Should be dynamic so I'm guessing a Do Loop may suffice and just use a boolean to flag whether there are more subs or not, but I havn't figure that out yet and is not a big concern right now. I'm more interested in the looping structure.
Loop through table for parent part numbers
get Material part number and loop through Part table to get sub-parts of current sub-part.
If records, then loop through them and continue on looping again until there are no more loops
End.
End.
BOM Structure
Parent Part
Sub Part 1
Sub Sub Part 1
Sub Sub Part 2
Sub Sub Part 3
Sub Part 2
Sub Sub Part 1
Sub Sub Part 2
........