I have a table called received values, eg:
Date - No. - weight
21Feb05 - X1 - 1500
21Feb05 - X2 - 200
22Feb - X3 - 500
etc
I have a table called despatched values, eg Total Weight 1300
I want a report which shows me Total Received less Total Despatched, but I want this figure to show as the latest records of the Received Values table.
So Total Received 2200 less Total Despatched 1300 = Still In Stock 900
The 900 should show as:
21Feb05 - X1 - 200
21Feb05 - X2 - 200
22Feb - X3 - 500
ie every time something is despatched the weight is removed from the oldest entry of the Received Values table, when the oldest entry becomes zero it take it from the next oldest entry, so you're left with a Received Not Sorted table showing the latest Received Value records that make up the weight.
Sorry if that's as clear as mud.
I was thinking a while loop that would say eg
while [latest entries in Received Values table are less than Received Not Sorted value] populate a new Received Not Sorted table with the latest Received Values records until new Received Not Sorted table total weight = Received Not Sorted weight.
Pass, I can't even explain it so I doubt anyone can help!!
Maybe if someone advised how to use while loops in Access that would be a start.
Thanks to whoever can help.
Date - No. - weight
21Feb05 - X1 - 1500
21Feb05 - X2 - 200
22Feb - X3 - 500
etc
I have a table called despatched values, eg Total Weight 1300
I want a report which shows me Total Received less Total Despatched, but I want this figure to show as the latest records of the Received Values table.
So Total Received 2200 less Total Despatched 1300 = Still In Stock 900
The 900 should show as:
21Feb05 - X1 - 200
21Feb05 - X2 - 200
22Feb - X3 - 500
ie every time something is despatched the weight is removed from the oldest entry of the Received Values table, when the oldest entry becomes zero it take it from the next oldest entry, so you're left with a Received Not Sorted table showing the latest Received Value records that make up the weight.
Sorry if that's as clear as mud.
I was thinking a while loop that would say eg
while [latest entries in Received Values table are less than Received Not Sorted value] populate a new Received Not Sorted table with the latest Received Values records until new Received Not Sorted table total weight = Received Not Sorted weight.
Pass, I can't even explain it so I doubt anyone can help!!
Maybe if someone advised how to use while loops in Access that would be a start.
Thanks to whoever can help.