That has resolved the crash due to the ambiguous reference, but I'm not getting the expected results now. However, that's more likely to be my coding! I'm going to spend some time testing and will get back to you if I require further assistance.
Thanks for your help resolving the initial problem.