Full Version: Print Pdf To A Specific File?
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
MikeGSuppe
Greetings

I have set up my code for export invoices to be printed via PDF. I have enjoyed setting up the code so that each file name can have a unique name with identification.

Now it is time to start going beyond that and print each file to a specific directory for each individual country we export to ie India or Taiwan etc

Are there any clues how this can be done?

Thanks

~mike

theDBguy
Hi Mike,

You could just include the directory path to the filename as you export the report to PDF, couldn't you?

Just my 2 cents... 2cents.gif
jwhite
Let's say the primary folder holding the country folders is called "C:\Data\Invoices".

If you store "C:\Data\Invoices" in a Defaults table:

tblDefaults
-----------------
DefItem, Text
DefValue, Text


Have a record: "PDFPath", "C:\Data\Invoices"

Then when you need to build the filepath, just do:

DLookup("DefValue","tblDefaults","DefItem='PDFPath'")

I presume you are already storing somewhere the country, so it might be something like:

strOutputFileSpec = DLookup("DefValue","tblDefaults","DefItem='PDFPath'") & "\" & strCountryName & "\" & strInvoiceNumber & ".PDF"
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.