Seems similar or an extension to your
previous post.
Can you step back and describe in simple terms the business process where this arises?
From my view:
- you have "items" that
- you store in "bins" and sometimes
- you have to move an item(s) from one bin to another bin.
You have multiple Items, and multiple Bins, and you need to know which Items are stored in which Bins. This is a many to many relationship.
So, your setup would include
tblItem, tblBin, and another tblBinContainsItem
tblItem---->tblBinContainsItem<----tblItem
You can query tblBinContainsItem and locate where ItemA exists.
You can update ItemA's location by
- remove ItemA from current location
- update ItemA to new location.
To move an item from one bin to another:
-Update the BinID field in tblBinContainsItem for the specific ItemID to the new BinID.
-Update the Quantity field if necessary
-Or, delete the existing record from tblBinContainsItem and insert a new record with the updated information.