AnsweredAssumed Answered

Nested Loop

Question asked by DustFairy on Mar 24, 2015
Latest reply on Mar 24, 2015 by philmodjunk


Nested Loop


I have been building a database that creates checksheets for machinery.





Currently I have an Inspection Checksheet layout with a portal to found Inspection Points for the machine being inspected.  The portal is populated by a Loop function that adds a new record for each inspection point that applies to the Machine Type.

I would like to expand the database to work on larger machines made up of varying numbers of parts.  For example a tower crane might have 5 mast sections and 4 boom sections.  Another tower crane might have 6 mast sections and 6 boom sections.  

Rather than have a separate inspection for each part I would like to group all the parts into the same Inspection.  I am thinking this might require a nested Loop.  The inner loop would populate each portal with the inspection points for the parts and the outer loop controls how many individual part portals are created.

Does this sound reasonable?   Can a layout have a varying number of portals?

An added wrinkle would be that boom sections would have different inspection points than mast sections so I might have to have a number of these nested loops in series to create the total inspection sheet.  

So I see the process being.  Set a local variable to the number of mast sections, Start the outer Loop, start the inner loop and build the first inspection portal (the inner loop is just a copy of my existing Loop), repeat the outer loop until the number of repeats equals the local variable, exit the Loop.  Then do the same process for the boom sections.

Sound reasonable?  My big concern is if the layout can have a variable number of portals.