pdf file name from field?

G

gtslabs

I want to print my report to a pdf file but the default file name is
always my report name. Can I reference a field in my report for the
new pdf file name?
 
B

Brian

How are you creating the PDF? Is this via code, or just printing to Acrobat
or CutePDFWriter or some other PDF creator.

I'm not sure if there is a way to do it directly, but if your report has a
Caption, the Acobat print engine is likely pulling from the Caption, not the
report name itself. My poor-man's solution might be to do this just before
opening the print dialog:

Me.Caption = ExportName 'where ExportName contains the value you want
Acrobat to use for the file name.

Then change the Caption back after the print.

There is probably a more sophisticated way.
 
B

Brian Carlson

Brian:
Could you please give greater detail on the make shift method you
have mentioned? I would like to create a command button on some forms and
reports that would save a PDF file with the filename being pulled from one of
the form/reports fields? In addition, if I wanted to have a command button
on the form that printed a PDF of a report associated with this records,
would I need this button to perform some action to ensure the data in the
form has been saved? Thank you in advance.

Brian
 
B

Brian Carlson

Brian:
I am wondering if you could provide some additional detail on the
suggestion you provided. I would like to use a command button to print
reports and forms to PDF, having the filename of the PDF pulled from a field
within the field or report. In addition, I am also wondering if I want to
have a ‘print to PDF’ command button on a form that prints a report
associated with the form to PDF, how do I ensure that the data in the form
has been saved in the table and thereby is able to be printed. Thank you in
advance.

Brian
 

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