Hi Kirk,
I changed it as you suggest and an initial test seems to show it working correctly now. I shall keep using it and let you know if it recurs.
Thanks for your help fixing this - your first reply pointing out it was very strange was on the money, but at least it looks (so far) like a simple workaround to stop it happening.