Solved

PrintTo PDF, user cancels error

Posted on 2014-12-17
1
134 Views
Last Modified: 2014-12-17
Hello,

I have a button on my report that will send the report to print as PDF

DoCmd.OutputTo acOutputReport, "rptMGMissingTimeOut", acFormatPDF


But if the user cancels the box that  comes up, I get the typical error to debug, ect.

What would I need to put to just cancel out the error and go back to the reportview?
Also how would I change the default report name that comes up?


Thanks in Advance!
0
Comment
Question by:Ernest Grogg
1 Comment
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
include error handling to your codes


On Error GoTo OuputPDF_Error

DoCmd.OutputTo acOutputReport, "rptMGMissingTimeOut", acFormatPDF

OuputPDF_Error:
    If Err.Number = 2501 Then
        MsgBox "Export was cancelled!"
        Err.Clear
        Exit Sub
    End If
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
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…

772 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

11 Experts available now in Live!

Get 1:1 Help Now