Changing print file name for each new report run

  • Thread starter Thread starter Roberta Hucks
  • Start date Start date
R

Roberta Hucks

Hello,
I've created a report that will be 'printed' to .pdf
format. The problem is that each report is for a unique
client and needs to be named appropriately. I'm looking
for a way to make the .pdf file name, when "printed", the
same as the client name that appears in the report header
each time a new report is run. I'm hoping this can be
done within the 'printing' dialog boxes, rather than
manually during the process.

Thank you for any assistance you can offer.
 
Roberta:

There is no way to do this automatically from within Access; especially to
read of the report header on the fly to create an output file name.

However, that said, you can automate the process. Normally how this is
done, is to open a recordset in Visual basic code and loop through that an
output each PDF file, using the current ClientID or other primary key as a
SQL filter for the output report to isolate that client for the specific
report and then to use the Client name as part of file name construct. (Be
careful here, to not allow client names with illegal file name characters
such as / " or other characters.)

Our PDF and Mail library will allow you to automate the process along the
lines outline above. There's plenty of sample code in the help file to get
you started. You'll find it on our web.
 
Back
Top