Solved

Creating PDF in Access 2013

Posted on 2014-12-09
4
365 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

10 Experts available now in Live!

Get 1:1 Help Now