I have a batch file which calls a macro in Access 2007. The macro is simple; it exports a report to a PDF. It works fine when running from within Access, but throws a "No Current Record" error when running the batch file.
My exact problem is also documented here: http://www.pcreview.co.uk/forums/thread-3990774.php
, sans a solution.
The macro has just two actions:
OuputTo: (Report, testreport, PDF Format (*.pdf), C:\TestReport.pdf, No, , 0, Print
I have also tried removing the Quit action but it makes no difference. I also read that it has to do with grouping so I created a non-grouped, non-sorted report and it still fails.
I also converted the macro to VBA and then created a simple RunCode macro calling that function. This time it ran without error (when called from the batch file), however it only exports page 1 of the report; beginning at the top of page 2 it displays #error for each field. This seems to have something to do with the way Access 2007 is reading the records when it prints, I just can't figure out how to get around it.
Thanks in advance,