Re: Snapshot to pdf code



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 pdf
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?



.



Relevant Pages

  • Re: parse cell contents
    ... extract the date I will get the yyyy-mm-dd format. ... What we will do is first look at the first word in the string. ... Dim ValidEntry As Boolean ... 'Set the pattern by using the Pattern property. ...
    (microsoft.public.excel.programming)
  • Re: Setting field properties in code
    ... format that the user has defined in the Windows Control Panel, ... >> Sub StandardProperties(strTableName As String) ... >> Dim tdf As DAO.TableDef 'Table nominated in argument. ... >> Dim ind As DAO.Index ...
    (comp.databases.ms-access)
  • Re: Zellformatierung vQ=B6llig_selbstherrlich_=2897=29?=
    ... indem Du das Format selbst exakt defninierst. ... >> Public Sub Sammeln(Name As String) ... >> Dim EingangAs String ... Eine Alternative ist auch der Makro-Recorder während Du eine Zelle als Text ...
    (microsoft.public.de.excel)
  • Re: Spellnumber - USD/AFa
    ... >>> format it returns me Afghani which is correct and also when I change ... >> Public Function DollarsAFAAs String ... >> Dim DecimalPoint As Long ... >> Dim TestValue As Long ...
    (microsoft.public.excel.misc)
  • Re: Connecting to a MySQL database through VB .NET
    ... first thing I learned from the error reports was the connection string ... Dim conn As New OleDb.OleDbConnection ... startRecord, Int32 maxRecords, String srcTable, IDbCommand command, ...
    (microsoft.public.dotnet.languages.vb)