Hello, I have the following forms and subform:
Purchase Order Form
Subform X (items in packages)
Subform Y (Items)
Total
SubForm_X (items in packages)
PackagesNameX (lookup field from Packages_Form.PackageName_p)
Subform_Y (Items)
(*)Material_Y
(#)Unit_Y
(#)Price_Y
Quantity_Y
Subtotal_Y
————
Materials_Form
Material_M
(#)Unit_M
(#)Price_M
Packages_Form
PackageName_p
Subform Z:
(*)Material_P
(#)Unit_P
Quantity_P
(*) Is a lookup field to Material_M in Materials_Form.
(#) Fetched from Materials_Form
What I am looking to do is auto populate the Subform Y (Items) based on the Subform X inputs, fetch the units and price, and if there are 2 of more equal materials, sum them. For example:
| Packages_Form | ||||
| PackageName_p | Package A | |||
| (*)Material_P | (#)Unit_P | Quantity_P | ||
| Cement | TON | 1 | ||
| Drywall | PIECE | 10 | ||
| Pipeline | PIECE | 20 | ||
| Packages_Form | ||||
| PackageName_p | Package B | |||
| (*)Material_P | (#)Unit_P | Quantity_P | ||
| Cement | TON | 2 | ||
| Drywall | METER | 5 | ||
| Brick | PIECE | 25 | ||
| Purchase Order Form | ||||
| Subform X | ||||
| PackagesNameX | ||||
| Package A | ||||
| Package B | ||||
| Package B | ||||
| Subform Y | ||||
| (*)Material_Y | (#)Unit_Y | (#)Price_Y | Quantity_Y | Subtotal_Y |
| Cement | TON | 10 | 5 | 50 |
| Drywall | PIECE | 15 | 20 | 300 |
| Pipeline | METER | 17 | 20 | 340 |
| Brick | PIECE | 2 | 50 | 100 |