$ 0 0 That's great, thanks. I applied the fix and I no longer see the error (so far). I noticed that the if@OrderBy='' appears twice in the code. Shall the replace be applied to both instances? Franco