Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Creating PDF in Access 2013

Posted on 2014-12-09
4
Medium Priority
?
487 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 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 85
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

664 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