UniqueData
asked on
Report to SnapShot with Where
I have a report that is being used two different ways:
1) DoCmd.OpenReport strReport, acViewPreview, , "ActionID = " & ActionID
2) An procedure that will loop through a recordset and open the same report but within each loop the single ActionID needs to be saved as a PDF and emailed, so I was going to use Leban's SnapshotToPDF routine. But I can't figure out how to make individual Snapshots using a 'where parameter'
1) DoCmd.OpenReport strReport, acViewPreview, , "ActionID = " & ActionID
2) An procedure that will loop through a recordset and open the same report but within each loop the single ActionID needs to be saved as a PDF and emailed, so I was going to use Leban's SnapshotToPDF routine. But I can't figure out how to make individual Snapshots using a 'where parameter'
Can you post your code so we do not have to recreate it?
UniqueData,
Something like the attached snip should work for you.
Jim
Something like the attached snip should work for you.
Jim
Dim x As Long
'Dim blRet As Boolean
Dim sPDF As String
Dim sName As String
Dim fso As New Scripting.FileSystemObject
Dim fil As Scripting.File
Dim strRootFol As String
Dim strDestFol As String
Dim fol As Scripting.Folder
strRootFol = "R:\FTP\"
sName = strRootFol
Set fol = fso.GetFolder(strRootFol)
If Len(sName & vbNullString) = 0 Then Exit Sub
' let's use the name of the selected Snapshot file
' to name our converted PDF document.
For Each fil In fol.Files
If fil Like "*" & ".snp" Then
sPDF = Mid(sName, 1, Len(sName) - 4)
ConvertReportToPDF(vbNullString, sName, sPDF & x & ".PDF", False, True, 0, "", "", 0, 1)
Else
End If
Next fil
ASKER
sorry, i am fine with the pdf creation and emailing. I am having an issue of how to create a snapshot report for a specific record. I don't see a 'where parameter' in the syntax of saving as a snapshot. And I can't make the report's recordsource look at a specific field to filter on because the report is called by two different forms for two different purposes.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ahh, perfect.
I didn't know the Output to and Open as hidden worked together like that.
Thanks
I didn't know the Output to and Open as hidden worked together like that.
Thanks
ASKER
snapshot where
;-)
The emailing bit requires a different process.
(Should be a new question)
JeffCoachman