I have a line of code in an Access 2003 .mdb that opens a report that outputs a file (note: the report is set to a printer that prints to a local port set to a file name). The very next line of code uses the WScript.Shell Object to run a DOS command to rename that file. It looks like the program sometimes tries to rename the file before the report is finished creating the file. Is there a way to halt execution of the next line of code until the report is finished outputting the file?
Test if the file is closed with this
Open in new window