Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Reports to PDF 1

Status
Not open for further replies.

henchcliffe

IS-IT--Management
Jun 13, 2001
23
US
Hi,
I am trying to automatically "print" reports to adobe distiller without any input. In distiller I have unchecked "Prompt for the PDF Filename" and "Ask to Replace existing PDF file." I also unchecked those boxes in the distiller printer document defaults.
What I would like to do is in Access print a report and have it automatically overwrite the previous report without asking me for a filename or if I want to overwrite the existing file.
Despite unchecking the necessary boxes I still get prompted.

Am I missing something? I am fairly new to distiller but it seems an easy enough program to use.

THANKS in advance...
 
you could use this VBA code to search for the file if it exist then delete it. Then save to .pdf

Public Function FileExist(filename As String) As Boolean
On Error Resume Next
FileExist = Dir$(filename) <> &quot;&quot;
If Err.Number <> 0 Then FileExist = False
On Error GoTo 0
End Function


paste the above function in a module
click the Modules TAB then New just paste the code in the white space.

Save the module

Call it like so in your code

If FileExist(yourpdf_file) then
Kill yourpdf_file
end if

DougP, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top