I
Ian Baker
I have a client who wishes a report to be created for each record in a table
and saved as a pdf file in a specific folder with a specific file name. The
PC on which the app resides has Adobe Acrobat 5.0 and the printer driver is
called "Acrobat PDFWriter". Printing anything to that driver causes a prompt
for a path/filename (so I am told).
The problem I have is that I don't have a copy of this print driver to
develop and test in so:
1. How do I set the specific printer to the pdf driver for the report - any
suggestions other than buying the pdf print driver myself.
2. How do I actually output the report as a pdf to a specific location with
a specific file name. I have the following code to date:
Public Sub CreateRCTI(ComCalcDt As Date)
On Error GoTo HandleErr
Dim rstPrinciple As Recordset
Dim RCTIpath As String
Dim strFileName As String
'Get the path for the pdf folder from the paths table
RCTIpath = DLookup("RCTIPDFExportPath", "tlDatabasePath")
'Open a query to get only the principles that have been paid on the
passed date
Set rstPrinciple = CurrentDb.OpenRecordset("SELECT tblAccount.AccountNo,
etc etc etc
'Loop through each paid principle and create RCTI report as a pdf file
and save
'in the designated folder with a specific file name for each
Do While Not rstPrinciple.EOF
'Construct the path and file name for this principle
strFileName = RCTIpath & Format$(rstPrinciple!AccountNo, "000000") & _
"RCTI" & Format$(Date, "yyyy-mm-dd") & ".pdf"
'Now here is the problem how do I do it
' DoCmd.OpenReport "rptRCTI", acViewPreview, , "PrincAccount=" &
rstPrinciple!AccountNo
rstPrinciple.MoveNext
Loop
Any help is really appreciated
--
Regards
Ian Baker
Jackaroo Developments Pty Ltd
Download Jackaroo (an IT Help Desk application) at Web:
http://jackaroo.net.au
and saved as a pdf file in a specific folder with a specific file name. The
PC on which the app resides has Adobe Acrobat 5.0 and the printer driver is
called "Acrobat PDFWriter". Printing anything to that driver causes a prompt
for a path/filename (so I am told).
The problem I have is that I don't have a copy of this print driver to
develop and test in so:
1. How do I set the specific printer to the pdf driver for the report - any
suggestions other than buying the pdf print driver myself.
2. How do I actually output the report as a pdf to a specific location with
a specific file name. I have the following code to date:
Public Sub CreateRCTI(ComCalcDt As Date)
On Error GoTo HandleErr
Dim rstPrinciple As Recordset
Dim RCTIpath As String
Dim strFileName As String
'Get the path for the pdf folder from the paths table
RCTIpath = DLookup("RCTIPDFExportPath", "tlDatabasePath")
'Open a query to get only the principles that have been paid on the
passed date
Set rstPrinciple = CurrentDb.OpenRecordset("SELECT tblAccount.AccountNo,
etc etc etc
'Loop through each paid principle and create RCTI report as a pdf file
and save
'in the designated folder with a specific file name for each
Do While Not rstPrinciple.EOF
'Construct the path and file name for this principle
strFileName = RCTIpath & Format$(rstPrinciple!AccountNo, "000000") & _
"RCTI" & Format$(Date, "yyyy-mm-dd") & ".pdf"
'Now here is the problem how do I do it
' DoCmd.OpenReport "rptRCTI", acViewPreview, , "PrincAccount=" &
rstPrinciple!AccountNo
rstPrinciple.MoveNext
Loop
Any help is really appreciated
--
Regards
Ian Baker
Jackaroo Developments Pty Ltd
Download Jackaroo (an IT Help Desk application) at Web:
http://jackaroo.net.au