thanks for all the replies..thanks doomfan..your code worked for me..i will just edit the code for my needs..