I have a system tracking orders and their line items. My question is primarily about a sub-form of the items for an order, we will call it tblOrderItems
Each item has a unique key - identity integer field.
Each item can also be tied to a master item - accessories for a given item that is ordered. There is a field called parentitem_cd. This is set to 0 if the item is a master/top level item.
There are several joined and calculated fields to show on each line item on this form - which I have working.
What I do is I set the sub-form to Select string using data from the master form. I only reference unique key and the parent_cd in the select statement.
then, for each record, a set of calculated fields pulls the necessary data to display the full record.
How can I sort this to ensure that child items fall under their respective parent item. For instance:
I hope this rambling question made sense. The most critical element is keeping child records sorted after their respective parent record.
Thanks.
Matthew Moran (career blog and podcast below)
Career Advice with Attitude for the IT Pro
Each item has a unique key - identity integer field.
Each item can also be tied to a master item - accessories for a given item that is ordered. There is a field called parentitem_cd. This is set to 0 if the item is a master/top level item.
There are several joined and calculated fields to show on each line item on this form - which I have working.
What I do is I set the sub-form to Select string using data from the master form. I only reference unique key and the parent_cd in the select statement.
then, for each record, a set of calculated fields pulls the necessary data to display the full record.
How can I sort this to ensure that child items fall under their respective parent item. For instance:
Code:
OrderItem_uno | item | parent_cd
13072 Pool 0 - this is a master item
13090 Skimmer | 13072 - this is a child of Pool
13075 Phone | 0 - master item
13080 Headset | 13075
etc.
I hope this rambling question made sense. The most critical element is keeping child records sorted after their respective parent record.
Thanks.
Matthew Moran (career blog and podcast below)
Career Advice with Attitude for the IT Pro