Yes, the script I have is precisely doing that and it works fine in Access 2003. But when I use that script in Access 2007, I get an error. And that is the real issue here. How do you export data through a quesry in Access 2007.
In Access 2003, this line works, but not in Access 2007...