Re: Snapshot to pdf code
- From: "Stephen Lebans" <ForEmailGotoMy.WebSite.-WWWdotlebansdot...@xxxxxxxxxxxx>
- Date: Tue, 12 Jun 2007 19:21:42 -0300
You would simply insert the code to convert the SNapshot TO PDF at the end
of your inner loop(after you close the current report). Look at the code
behind the CommandButton on the sample COnvert Snapshot to PDF form. It's
that simple.
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Vavs" <Vavs@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E423544F-7368-453D-850E-98795F8BB43C@xxxxxxxxxxxxxxxx
I have a program which basically loops through a table and produces custom
reports for a series of 70 managers. I am producing them in .snp format.
I
would like to use your code to take the snp files and convert them to pdf
so
that the managers can read them. I have a report with a series of sub
reports and the rtf output does not retain the original format.
I used your program on one of the files I had produced in test and it
worked
very well. I guess I would rephrase my question to : How do I
incorporate
the portion of the code which converts the snp to pdf? I am listing the
code
I produced at the end of this message. I would like to think I can
include
it somewhere in my loop.
Private Sub cmdOpen_Click()
Dim strDocName As String
Dim strWhere As String
Dim strWhereApp As String
Dim strSQL As String
Dim strApprover As String
Dim rs As Recordset
Dim db As Database
Dim strSnap As String
strDocName = "rptSoxJuly"
'strApprover = "Keith Gustely"
Dim qdf As QueryDef
Set qdf = DBEngine(0)(0).QueryDefs("rptSOXJuly")
Set db = CurrentDb()
Set rs = db.OpenRecordset("DistinctApprover", DB_OPEN_TABLE)
rs.MoveFirst
Do While Not rs.EOF
With qdf
strApprover = rs.Fields("AppName").Value
strWhereApp = "Where Approvers.AppName = " & "'" &
rs.Fields("AppName").Value & "'"
'strWhere = "Approvers.AppName =" & strWhereApp
strSQL = "SELECT AS400CSTCTR.*, Approvers.AdminApproverName,
Approvers.AppName FROM AS400CSTCTR INNER JOIN Approvers ON
AS400CSTCTR.dspSysCostCenter=Approvers.CSTCTR " & strWhereApp
'.SQL = "SELECT AS400CSTCTR.*, Approvers.AdminApproverName,
Approvers.AppName FROM AS400CSTCTR INNER JOIN Approvers ON
AS400CSTCTR.dspSysCostCenter=Approvers.CSTCTR WHERE ((Approvers.AppName) =
(strApprover))"
.SQL = strSQL
DoCmd.OpenReport strDocName, acViewPreview
DoCmd.OutputTo acOutputReport, , acFormatSNP, "c:\windows\SOXReports\" &
strApprover & ".snp"
strSnap = "c:\windows\SOXReports\" & strApprover & ".snp"
DoCmd.Close acReport, "rptSOXJuly", acSaveNo
End With
rs.MoveNext
Loop
End Sub
"Stephen Lebans" wrote:
I do not understand your question. Are you referring to the ReportToPDF
solution? It creates a temporary Snapshot file which it deletes at the
end
of the process. The end user does not have to convert their reports to
Snapshot format.
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Vavs" <Vavs@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0A4C2CCE-6665-40F8-8485-4506715B608A@xxxxxxxxxxxxxxxx
I downloaded the zip file and looked at the code. I have code attached
to
a
form that creates the 70 reports I need based on a table. I want to
incorporate this code to take the file in snapshot and convert it to
right away. If possible, I would like to save that file in a different
folder so that I don't have two files with the same name (different
extensions) hanging around. Can someone explain what I need to do to
incorporate the two sets of code?
.
- Follow-Ups:
- Re: Snapshot to pdf code
- From: Vavs
- Re: Snapshot to pdf code
- References:
- Re: Snapshot to pdf code
- From: Stephen Lebans
- Re: Snapshot to pdf code
- From: Vavs
- Re: Snapshot to pdf code
- Prev by Date: Re: Snapshot to pdf code
- Next by Date: Re: Calculations In Report
- Previous by thread: Re: Snapshot to pdf code
- Next by thread: Re: Snapshot to pdf code
- Index(es):