Thanks for all your help aalavar - I've just tried out the code on a different database and it's worked so at least I know it's something to do with the recordset being brought in. I'm going to get hold of the database and go through the data directly but I'm confident now thats where the problem lies.
Once again thanks for all your help.