First off, I am using Access 2010. I have a table [selecting_locations] that lists item number, warehouse location, and qty. For example
item_nbr location qty
123456 P123A 1
123456 P321A 5
123456 P123B 10
654321 C456D 2
654321 C654D 1
654321 C345A 6
and another table [order] that shows the qty of each item that needs to be selected. For example,
item_nbr qty
123456 1
654321 3
These tables could contain thousands of rows depending on the order. How can I extract only the records from [selecting_locations] that add up to the qty in the [order] table? For example, only the following records would be returned.
item_nbr location qty
123456 P123A 1
654321 C456D 2
654321 C654D 1
I'm assuming that I need to loop through the recordset, but honestly have no idea where to start. If you could point me in the right direction, it would be greatly appreciated.
item_nbr location qty
123456 P123A 1
123456 P321A 5
123456 P123B 10
654321 C456D 2
654321 C654D 1
654321 C345A 6
and another table [order] that shows the qty of each item that needs to be selected. For example,
item_nbr qty
123456 1
654321 3
These tables could contain thousands of rows depending on the order. How can I extract only the records from [selecting_locations] that add up to the qty in the [order] table? For example, only the following records would be returned.
item_nbr location qty
123456 P123A 1
654321 C456D 2
654321 C654D 1
I'm assuming that I need to loop through the recordset, but honestly have no idea where to start. If you could point me in the right direction, it would be greatly appreciated.