macro print to pdf

G

Guest

I have a number of reports that I want to set up in a macro and then print to
a pdf file. Can I do this and also how do I define the "save as" for the PDF
 
S

Steve Schapel

Sierra,

You need to have a PDF driver installed on your computer. There are
many such available. I like PDF995.

Then, in design view of the report, go to the File|Page Setup menu. On
the Page tab, select Specific printer, and then select the name of your
PDF driver.

After that, printing the report via the OpenReport action in a macro
will result in the report being output as a PDF.

If you are using Access 2007, you have other options. If you need more
flexibility, you will need a VBA-based solution.
 
G

Guest

Yes, I've got that now, but before it prints (I use DeskPDF) a window open
asking for a file name to print/save. How can I specify a file name using a
macro?
 
G

Guest

Hi Steve, Sierra
I’m new to this world, so apologies for not having signed in and posted
back to the office developer website where I found this reply to Sierra’s q
about a macro to write to a pdf, and i have a question that seems similar to
me..

I have a huge access 2000 database (320,000 records in the main table,
about 12 lookup tables) and a series of queries and reports that run
from it, which I need to automate before I go mad.
Basically, I open a report, which formats these 320,000 records into a
humungous report and they’re all muddled up, with everybody’s data in
together.
a drop-down list of 60 people appears in a dialog box. I select one of
the people, and the report churns out 1/60 of the original report, and
everything on the report is relelvant to that person from the list. I
dump this to a pdf using PDF995.
I then select the next person in the list of 60 and do it all again. I’m
going mad because the size of the file means it takes 20-30 minutes for each
person on the list, and it’s utterly predictable what to do - perfect for a
program solution? A colleague thinks a macro could be made to run over the
top of the existing report which would set to churn away for a week and do
it all. What do you think?
Before you ask - I’m stuck with the hardware and software that I’ve got,
there’s no money - or people - to upgrade.
Would very much appreciate a steer! apologies for butting in on this
thread, let me know if this is not appropriate.
Kate Fletcher
Information Analyst
Mondays & Tuesdays: Linden House DDI +44 (0)115 942 8696 / Internal
48696
Thursdays & Fridays: 4.01 Standard Court
DDI +44 (0)115 912 3326 / Internal 49326
FAX +44 (0)115 912 3351 / 49351
(e-mail address removed)
Wednesday: out of office on study leave
 
G

Guest

I think I had a similar thing when I output to an EXCEL spreadsheet - I used
Output To in the macro, and that gave me the opportunity to specify Output
File, which could have a long pathway but I don't know frinstance how you
would transfer a variable from, say, a form or list of input files into this
field to get a unique name.

anyway this stopped the window opening and getting in the way of my macro
running....
 
S

Steve Schapel

Kate,

I am not sure what is causing this process to take so long. 320,000
records is fairly meaty, but not what I would call "huge". Each run of
the report must only be about 6,000 records on average, and there is no
way this should take 20-30 minutes. I guess the report might be based
on a very complex query, with lots of calculations and so forth?

In any case, this involved "looping" logic, which trends to be quite
awkward with a macro. I would say a VBA procedure would be a great
advantage here.
 

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