create PDF filename

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
 
R

Rob Parker

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
 

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