OK I put the code in a module and it still will not compile. Now I get an error saying it cannot find the object or library on a line of code that is manipulating a text string with the MID function. It highlights MID with the error. BTW, I have a FORMS and a TYPES module. Does everything have to go in the regular module?