Solved

Creating PDF in Access 2013

Posted on 2014-12-09
4
375 Views
Last Modified: 2014-12-09
Creating a PDF with docmd.outputto acformatPDF works fine with MS Access 2013. However, and this is a mayor problem for me, it creates the exact same PDF after I mutated the record. It doesn't matter if I change the output name or even if I change to another record. The only way to get the right PDF is exit the database, starting it up again and creating the  PDF. Then the PDF is OK. If I then create another PDF, the first one keeps appearing. It is like it stays in the cache or something.

I use the same command line as everyone else:
    DoCmd.OutputTo acOutputReport, "ReportName", acFormatPDF, stndrdMap & stndrdFile, False

If I use docmd.SendObject acSendReport this works fine until I use OutputTo. Then SendObject has the same problem.

What can I do?
0
Comment
Question by:ErnstvanderHeijden
  • 2
  • 2
4 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40488572
Can you show the full code? Generally there is more to the process, something like:

DoCmd.OpenReport "YourReport", , , "Where Clause", acHidden
DoCmd.OutputTo acOutputReport, "YourReport", acFormatPDF, "Output Path"
DoCmd.Close acReport, "YourReport"

Also, how are you setting the values of stndrdMap & stndrdFile?
0
 
LVL 84
ID: 40488576
Also, this is somewhat troubling:
If I use docmd.SendObject acSendReport this works fine until I use OutputTo. Then SendObject has the same problem
It's possible you have issues with the installation of Access on your machine. I'd suggest you insure that you have fully updated your Windows and Office installations, and that you've applied any relevant hotfixes.
0
 

Author Comment

by:ErnstvanderHeijden
ID: 40488602
Thank you so much for your answer. At first I was very sceptic about the way anyone could help me with this problem.

But you asked me for the rest of the code and that made me think. What if, as you sugested, the rest of code is the problem and not the line itself.

So I eliminated the rest of the code and changed the line:

    DoCmd.OutputTo acOutputReport, "Aanvraag", acFormatPDF, "C:\BaSIS\123467890.pdf", True

The problem was gone.

Thank you so much. I'm going to look now what made the problem rise.
0
 

Author Comment

by:ErnstvanderHeijden
ID: 40488626
The problem in code is this:
    Report_aanvraag.Logo.Picture = stndrdMap & "\BWBI.jpg"

When I delete this line from the code, everything works perfect. And I don't need to change the logo no more, so problem solved.

Once again, thank you very much.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sending email from List Data 2 50
MS Access Append Query From CSV File Into Multiple Tables 26 47
Open a Specific Record With a Specific Tab Page 5 28
Run Time Error 3071 26 36
Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now