Hello Everyone
I’ve been trying to use some code to automate the production of quality reports from a database. I’ve used similar code before and it’s given me the results, I even had this working before I left work last night!!!!
The code should collect all the records as per the SQL, I know the records exist as I’ve put them there specifically in the ‘test’ data I’m using. It should then create the relevant number of Word reports. These are then attached to an email generated later along with Excel charts.
The OutLook and Excel automation work fine, the only thing I can see when i set break points and scan the code is the the rstWord recordset is always empty. I’ve used the SQL code in a query (once modified suitably) and it does work, unless the code is stopped on a breakpoint. I also use similar SQL strings to populate sections of the Excel and OutLook code.
The code is attached, if you can work out where I’m wrong please tell me, if not recommend a good Psychiatrist as Access is winning in the sanity wars…
Thanks
Ian