Thanks Bruce. I understand now what my error was and the code works.