UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Generating Pdf Files, Any Version    
 
   
as2solutions
post Jul 18 2019, 01:41 PM
Post#1



Posts: 109
Joined: 8-June 04



I'm using a macro (ExportWithFormatting) to generate a pdf from an existing report. I am currently leaving the "Output File" empty so that the user is prompted to key in the output location and file name.

What I am hoping to accomplish is to feed the output location and file name for the PDF from a table, which contains both the output location and file name, therefore removing the manual step of prompting the user.

Any ideas??
Go to the top of the page
 
MadPiet
post Jul 18 2019, 01:42 PM
Post#2



Posts: 3,299
Joined: 27-February 09



use VBA and a loop to pass the parameter/filter values to the report, then output
Go to the top of the page
 
theDBguy
post Jul 18 2019, 01:54 PM
Post#3


Access Wiki and Forums Moderator
Posts: 76,315
Joined: 19-June 07
From: SunnySandyEggo


If you want to keep using a macro, you could try using the SearchForRecord action and store the information in a LocalVar.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
as2solutions
post Jul 18 2019, 02:00 PM
Post#4



Posts: 109
Joined: 8-June 04



Do either of you have any example db's. I am not advanced enough in my programming abilities.
Go to the top of the page
 
theDBguy
post Jul 18 2019, 02:06 PM
Post#5


Access Wiki and Forums Moderator
Posts: 76,315
Joined: 19-June 07
From: SunnySandyEggo


Hi. It might be simpler if you could post a sample db we could modify for you. This way, whatever we do, we can be somewhat certain will apply to your specific situation, and you won't have to "interpret" what we did, trying to apply it to your own db.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
as2solutions
post Jul 18 2019, 06:00 PM
Post#6



Posts: 109
Joined: 8-June 04



Thanks everyone! I poked around and found some code that works great. All I had to do was tweak it a little bit.

DoCmd.OutputTo acOutputReport, "rptSales_Detailedit_Offlinewithout_AutoPDF", _
acFormatPDF, "C:\PDFS\" & [filename] & " - " & [filenumber] & ".pdf"
Go to the top of the page
 
MadPiet
post Jul 18 2019, 06:22 PM
Post#7



Posts: 3,299
Joined: 27-February 09



I thought instead of this:

QUOTE
What I am hoping to accomplish is to feed the output location and file name for the PDF from a table, which contains both the output location and file name, therefore removing the manual step of prompting the user.


you were going to loop through a table to get the filter values "[FieldName]='" & rs.Fields("MyFieldName") & "'"

Guess not, though. If you have to do that, let us know. It's pretty simple if you know how to play with recordsets.
This post has been edited by MadPiet: Jul 18 2019, 06:22 PM
Go to the top of the page
 
theDBguy
post Jul 18 2019, 10:25 PM
Post#8


Access Wiki and Forums Moderator
Posts: 76,315
Joined: 19-June 07
From: SunnySandyEggo


Hi. Congratulations! Glad to hear you got it sorted out. Good luck with your project.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    20th September 2019 - 07:38 AM