Outputto reports- custom name (1 Viewer)

Leo_Polla_Psemata

Registered User.
Local time
Today, 14:01
Joined
Mar 24, 2014
Messages
364
How to save an access report but with a custom name name
that is pulled out of the report header?

So far I can save reports as document, document name is the report name and i have to change it manually.
Could I do it automatic?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 14:01
Joined
Aug 30, 2003
Messages
36,125
You can open a recordset or use DLookup() to get the desired data, then concatenate that into the name.
 

Leo_Polla_Psemata

Registered User.
Local time
Today, 14:01
Joined
Mar 24, 2014
Messages
364
You can open a recordset or use DLookup() to get the desired data, then concatenate that into the name.


Dear pdaldy, so far I am using Docmd method

DoCmd.OutputTo acOutputReport, "table1", acFormatPDF, "C:\Users\Cpc\Desktop\depo\nameofdocumentasfieldA.pdf"

How can I interfere in the last part and I save a report with, say,
ABC1.PDF and ABC2.PDF

This report retrieves data from a table using [forms]![something]![id]
So, its time this report outlines a different unique info piece in the header, say ABC1 or ABC2 .
So, the pdf document I save in a specific folder (depo), should use the name ABC1 name etc.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 14:01
Joined
Aug 30, 2003
Messages
36,125
If it can get the value from the form:

Code:
DoCmd.OutputTo acOutputReport, "table1", acFormatPDF, C:\Users\Cpc\Desktop\depo\" & [forms]![something]![id] & ".pdf"
 

Users who are viewing this thread

Top Bottom