How to close a *.PDF report in VBA

F

FSHOTT

I am working on an application which is to send ACCESS reports to suppliers
(Monthly Supplier Performance Report cards). I am using the VBA code from the
references which I was directed to, from this forum. I use the Stephan Labans
code to convert the ACCESS report to a PDF format. I send a MS Outlook
message with 2 attachments (a snapshot {snp} and PDF version of the report).
Currently the code works if I close the open PDF version of the report before
the code increments to the next supplier (next recordset record). If I do not
manually close the displayed PDF file I get an error message (permission
denied) when I try to execute the Kill (“C:\SupplierReportCard.PDFâ€) and loop
to the next supplier. I am thinking I need to close the open PDF file after
sending the Email and before looping to the next supplier in the recordset. I
currently do not know how to do this. I use a DoCmd.Close acReport to close
the ACCESS version of the report but this does nothing for the PDF version.
So my question is, is my assumption correct that I need to close the report
before looping and if so how do I do this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top