Thanks a lot, thats works perfectly. And thanks for the advice on not using IIf.