Using report names for Report To PDF

L

Larry

Good morning,
I recently downloaded the Report to PDF from Stephen Lebans. I have
question about how to pick "one" report have it PDF, not "all" the reports.

What I have:
I have an SOP database so we can standardize our SOP process. The PDF works
great but I want to choose a list of Names of SOP's instead of reports. so
basically I would have a list box just like the one in his example but
instead of showing the reports it would show the names of the different SOP's
in the database. Then I would click on it as normal or click the PDF button
to run the program.

The me.lstRptName.value is where it picks the report to PDF.

So what do I put in the "me.lstRptName" instead?

Larry

My question:
Where do I put that filter criteria?

Private Sub lstRptName_DblClick(Cancel As Integer)
Dim blRet As Boolean
' Call our convert function
blRet = ConvertReportToPDF(Me.lstRptName.Value, vbNullString,
Me.lstRptName.Value & ".PDF", False)
' To modify the above call to force the File Save Dialog to select the name
and path
' for the saved PDF file, simply change the ShowSaveFileDialog param to TRUE.
End Sub
 
T

Tony Toews [MVP]

Larry said:
I have an SOP database so we can standardize our SOP process. The PDF works
great but I want to choose a list of Names of SOP's instead of reports. so
basically I would have a list box just like the one in his example but
instead of showing the reports it would show the names of the different SOP's
in the database.

What are SOPs in the Access database? Are these specific reports or
individual records in an SOP table? My reply assumes you mean that
you want to use one report and there are individual records in an SOP
table.
So what do I put in the "me.lstRptName" instead?

You put in the exact name of the report.
Where do I put that filter criteria?

For a page on how to print a report for a single record and how to
generate reports to attach to emails see the Emailing reports as
attachments from Microsoft Access page at
http://www.granite.ab.ca/access/email/reportsasattachments.htm

Tony
 
L

Larry

Thanks Tony for the response...I starting to feel hopeless and lost. :)

Should I create separate reports in this DB? I thought by having a drop down
of what SOP they want would be the better option.

Currently I have a parameter that pops up asking for the "ID" (which is the
PK) number of the SOP I want, But everyone won't know that number. So when I
run the report that Mr. Lebans has done, it starts, then prompts for the ID
number, the PDF's the correct report. Which is fine with me, but I would
like to see it pop up a list of the SOP's titles for people to look up.

I have a form with a combo box that pops up, choose the report you want to
print, and it works.

I am new to this type of forum, is there a way for me to attach my DB on
here? I think it would help.

Larry
 
T

Tony Toews [MVP]

Larry said:
Thanks Tony for the response...I starting to feel hopeless and lost. :)

Should I create separate reports in this DB?

No, not at all. Assuming the only difference is the records they are
based on.
I thought by having a drop down
of what SOP they want would be the better option.

Ok, so each SOP is a different record.
Currently I have a parameter that pops up asking for the "ID" (which is the
PK) number of the SOP I want, But everyone won't know that number. So when I
run the report that Mr. Lebans has done, it starts, then prompts for the ID
number, the PDF's the correct report. Which is fine with me, but I would
like to see it pop up a list of the SOP's titles for people to look up.

I have a form with a combo box that pops up, choose the report you want to
print, and it works.

In the query that the report is based on you can set the criteria
field to be the combo box field on the form. For example
Forms!FormName!ComboBoxName.

Tony
 

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