create PDF filename

  • Thread starter Thread starter shank
  • Start date Start date
S

shank

I created a report with an ID# as one of the fields.

When I go to print a PDF, I'm prompted for a filename.

I'd like to get that ID# into the filename automatically.

How do I get that done?

Presently, it appears the Caption is the filename. However, I don't see
where I can build a caption dynamically.

thanks
 
You can do this with a single line of code, after you open the report.
Here's an example:

DoCmd.OpenReport "rptTypes", acViewPreview, , "ID = " & Me!ID
Reports("rptTypes").Caption = "ID = " & Me!ID

If I select record with ID 101, then print this to a pdf file, the default
filename is "ID = 101.pdf"

HTH,

Rob
 
Back
Top