I am running Access 2010 and want to print a batch of invoices using an Access Report. However, if an Invoice is marked with one or more associated pdf files(s), I want to close the Invoice Report, print the pdf file(s) and then restart the Access Report with the next set of Invoices. Only about one in ten Invoices will have an attachment, so I'll print a batch of about 10 Invoices, before I need to print any pdf file(s).
I'm using the following ShellExecute command to print the pdf file(s):
ShellExecute(0, "Print", strPathAndFilename, vbNullString, vbNullString, 0)
The problem I'm getting is that the Access report for the subsequent batch of Invoices gets to the printer before the pdf files and, therefore, the documents are out of sequence. I am currently trying to put a ten second delay between the two, different tasks and that works most of the time. However, is there something I can test after the ShellExecute command to see when that is done before continuing to the next batch of Invoices?
Thanks, Eddie