If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Inventory Loop
I need a way to loop through an invoice and figure out the number of boxes
being used per order. We have the same product that can go into multiple size boxes depending on the quantity shipped. For example: Widget A with a shipped quantity of 1 would go into box A which is 4X4X12 Widget A with a shipped quantity of 2-4 would go into box B which is 6X6X10 Widget A with a shipped quantity of 5 would go into both box A & B (1 each) Thanks Jim |
#2
|
|||
|
|||
Inventory Loop
Jim
I'm going to assume that you'd want to use the most appropriate box first .... in your example, the third quantity (5) would, because it is greater than the capacity of BoxB, would have the capacity of BoxB (4) subtracted, then the most appropriate box for the remaining count (1), which would be BoxA. Or if you don't want to do the looping (Access is a relational database ... you don't really need to loop), what if you used the MOD function to find out how many BoxB's you can use, and use the remainder to see if you need a BoxA? Do you have a table that lists how many of which items can fit in which boxes? If not, start there. You can use that to look up the box capacity for your MOD() function. Good luck! Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "Jim" wrote in message ... I need a way to loop through an invoice and figure out the number of boxes being used per order. We have the same product that can go into multiple size boxes depending on the quantity shipped. For example: Widget A with a shipped quantity of 1 would go into box A which is 4X4X12 Widget A with a shipped quantity of 2-4 would go into box B which is 6X6X10 Widget A with a shipped quantity of 5 would go into both box A & B (1 each) Thanks Jim |
#3
|
|||
|
|||
Inventory Loop
You need to create a table tblBoxSelect with three fields --
Product QTY Box_Size Left join Invoice to tblBoxSelect on Product and Size. Need_Box: IIF(tblBoxSelect.Box_Size Is Null, "Unknown", tblBoxSelect.Box_Size) Or Need_Box: IIF(Invoice.Product = tblBoxSelect.Product AND Invoice.QTY = tblBoxSelect.QTY, tblBoxSelect.Box_Size, "Unknown") -- Build a little, test a little. "Jim" wrote: I need a way to loop through an invoice and figure out the number of boxes being used per order. We have the same product that can go into multiple size boxes depending on the quantity shipped. For example: Widget A with a shipped quantity of 1 would go into box A which is 4X4X12 Widget A with a shipped quantity of 2-4 would go into box B which is 6X6X10 Widget A with a shipped quantity of 5 would go into both box A & B (1 each) Thanks Jim . |
Thread Tools | |
Display Modes | |
|
|