Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Indented Bill-Of-Material

Status
Not open for further replies.

SunOfDog

Technical User
Oct 13, 2009
3
US
Hello,

I'm trying to put together a bill-of-material listing from a MS Access database. I have the connection and sql working to pull data from Access. The question is the approach I should use to turn the table to an indented BOM. The table columns are:

PartNmbr
ChildPartNmbr
Qty

What i'm trying to do is something like this:

search PartNmbr field for specified string
if found add to list along with ChildPartNmbr
then check to see if ChildPartNmbr is in PartNmbr field
if it is then add to a sub list and so on

There are around 6 to 7 levels deep, but solution needs to handle less or more if need be.

I'm looking for some direction. I'm not sure if I should use list, dictionary, array, something else?

Thanks.
 
Maybe something like this:
-you have a sequence of records of the form, PartNmbr, ChildPartNmbr, Qty.
-make a list of lists like [PartNmbr:(ChildPartNmbr, Qty)], that is, for each record, the item0 is PartNmbr and the item1 is a tuple, (ChildPartNmbr, Qty).
-Then you can sub-list while item1[0] is found in item0.

_________________
Bob Rashkin
 
Thanks Bob. Your pseudo code is what I'm looking for. I appriciate your reply.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top