Lebans ReportToPDF question

G

Guest

I need to "automatically" export a report to a pdf file. Currently the report
is run from a form in which the user enters various "where" condition
criteria in various input controls. When they click the "Run Report" button
the routine constructs the where condition and uses the following command:
"DoCmd.OpenReport strRpt, acViewPreview, , strWhere".
I desperately want to use Mr. Lebans work as it will make my life and the
lives of my users substantially better but I don't know how to implement the
where condition. In the ReportToPDF routine there's a parameter for "Report
Name" and I see it uses the DoCmd.OutputTo command and none of these have a
similar parameter for a "where" condition.
I'm sure there's a simple answer to this but I've stumbled into a hole in my
Access knowledge. If anybody can help me dig out of it I'd sure appreciate it.

Cheers,
Jon
 
S

Stephen Lebans

You need to learn to search GoogleGroups. This very same issue comes up a
lot with anyone trying to export the Report to Snapshot, RTF or any of the
other supported export formats.
Here's a post on this subject. If It does not answer your question
sufficiently then use GoogleGRoups to research other relevant threads.


<<headers clipped
hi steve,

you know for whatever reason i was a little dis-heartened when i quickly ran
my gaze over the ms information. i returned to the printed document a while
later and read through it slowly and the cloud of doubt and unknowing seemed
to begin disappearing. after i tried creating a macro with the appropriate
where condition and assigning that (macro) to the 'OnOpen' conditon i found
that the new report i had minted that used this _could_ indeed be output
with
just the requisite filtered records as a 'SNP' formatted file.

thanks for the tip.

i can use this and share it.



SA said:
Ted:

Take a look at this knowledge base article which describes filtering a
report for faxing using Send Object. You can apply the same type of
construct to outputting a snapshot.

http://support.microsoft.com/kb/299016/en-us
--
Steve Arbaugh
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg

Ted said:
i am a relative newbie to this so you'll have to excuse this if the
answer
is
totally obviouso, but how do you programatically restrict the output to
just
those records meeting your 'where' specifications. i am not seeing a
place
when i write the output command below to insert my where clause as i did
when
i created another cmd button to print the identical report:

Private Sub OutputSnp_Click()

On Error GoTo Err_OutputSnp_Click

Dim stDocName As String
Dim strWhere As String

stDocName = "By Site: Patients on Follow-Up"
strWhere = "[FollowUp] Between #" & _
Forms![Tracking Print By Site]![StartDate] & _
"# And #" & Forms![Tracking Print By Site]![StopDate] & "#"

DoCmd.OutputTo acOutputReport, stDocName, "SnapshotFormat(*.snp)"
?????

Exit_OutputSnp_Click:
Exit Sub

Err_OutputSnp_Click:
MsgBox Err.description
Resume Exit_OutputSnp_Click
End Sub


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top