So i gave this more thought. If you can live with only displaying the result in the main report maybe this
might work...I did not test it but I think the theory/logic is sound. he main issue is it will run a subreport on every detail line so your performance may go way south...
The idea will be to make a subreport to only show (not return in any variable) one value which is your Available Quantity 'Field'.
YOu will have to tweak this but ...
Make the sub report uising the same raw data set
link the main report to the subreport on partnum and shipdate (and maybe an inventory number?)
in the sub report use the links to limit the full data set to only row swith the same partnum and the date is <= link date. This should give you limited data set that you can then use a formula to get the final 'Available Quantity ' fotr that partnum on that date
sum(quantity)-maximum(onhand)
hide everything except this final value which would be displayed in the main report.
Basically the subreport has to recalculate from scratch the vfalue on each run but it avoids trying to match shared variables for all the number parts, which is handled by the subreport linking,.
Edited by DBlank - 15 Aug 2012 at 10:12am