Good points, but I have been successful in getting the code to run correctly. See my final comment above. It is hard to get a complete understanding of the logic of the code without the context, I do appreciate.
Cheers.
All good. I used the ret statement as suggested, and after passing some Nz's and other parameters to cover Null values in various fields, I got it to run as a Public Function I can now call from anywhere.
This might not be THE best way to code this but I understand what is going on and I can...