Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Convert report to PDF

Posted on 2014-12-28
10
Medium Priority
?
233 Views
Last Modified: 2014-12-30
Hi EE

Using Access 2010 I have the following

DoCmd.OutputTo acOutputReport, "rptHoistFaultReport", acformatpdf, Tlocation, False

running in Window 7 all works ok but in Window 8, I get the following   "The Output to Action was Cancelled"

I have the same problem using the following in Access 2003
blRet = ConvertReportToPDF("rptHoistFaultReport", vbNullString, Tlocation & ".pdf", False, False, 150, "", "", 0, 0, 0)
in Access 2003 I don't get any error messags it just doesn't save in PDF format
Works fine under Windows 7 but not in Windows 8.

It seem the common problem is Windows 8

Any help appreciated

chestera
0
Comment
Question by:chestera
[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
  • 6
  • 2
  • 2
10 Comments
 
LVL 40

Accepted Solution

by:
als315 earned 1000 total points
ID: 40521554
I don't see any problems with your code in Access 2010 (32 bit) in Windows 8 (64 bit)
Please, check validity and access rights of Tlocation
0
 
LVL 31

Assisted Solution

by:Helen Feddema
Helen Feddema earned 1000 total points
ID: 40521967
Try saving the PDF to the current path -- if that works OK, it is probably a security issue with the Tlocation path.
0
 

Author Comment

by:chestera
ID: 40522655
als315
There is no problem with the code as stated it works under windows 7 but not under windows 8. The Tlocation is not complex it's a test location   C:\Reports\File.pdf



Alan
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:chestera
ID: 40522660
Helen Feddema

Hi Helen

There is no problem with the code as stated it works under windows 7 but not under windows 8. The Tlocation is not complex it's a test location   C:\Reports\File.pdf

Not sure your meaning Security issue

Alan
0
 

Author Comment

by:chestera
ID: 40523134
Helen Feddema
I changed the location for testing purpose to the same folder as the .mde which is "C:\PPTworkshop" so
Tlocation becomes "C:\PPTworkshop\File.pdf" and it worked under windows 8. So you were on the right track. I will now experiment with different locations. Ultimately it will be saved to a server.


Alan
0
 
LVL 40

Expert Comment

by:als315
ID: 40523156
You should check access rights to folder  C:\Reports:
1. Select folder in explorer, press right mouse button and select "Properties"
2. Open Security tab and look at folder rights.
You should have full access rights to this folder
0
 

Author Comment

by:chestera
ID: 40523205
als315

I have found the problem.
Tlocation = "C:\PPTworkshop\Report" & Hoistnum & "FaultReport" & Tdate
Its the date that is the problem, if I remove Tdate
Tlocation = "C:\PPTworkshop\Report" & Hoistnum & "FaultReport"
It works

With the date added I get the error "The Output to Action is Cancelled"

Not sure why Tdate is a problem under Windows 8

Alan
0
 
LVL 31

Expert Comment

by:Helen Feddema
ID: 40523877
That could depend on the date format -- if it is mm/dd/yyyy, for example, the slashes will not work in a file name.  Try mm-dd-yyyy to avoid this problem.
0
 

Author Comment

by:chestera
ID: 40524297
Helen Feddema

My dates are always set,  in my case dd-mm-yyyy. Appreciated your help although a simple resolution I was going on this narrow track thinking Windows 8 was the problem not the location, until you and als315 suggested a location problem.
If you don't mind I will split the points between you and als315
0
 

Author Closing Comment

by:chestera
ID: 40524716
Thank you both for your help
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

610 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