Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228

    Output action is canceled

    This is a continuation from my earlier thread. The error I am now getting is :



    2501

    the output to Action was cancled.

    Code:
    Private Sub Command26_Click()
    
    Dim myPath As String
    Dim strReportName As String
    
    myPath = "C:\Documents and Settings\"
    strReportName = [Quote_ID]
    
    DoCmd.OpenReport "QuoteMain", acViewPreview
    DoCmd.OutputTo acOutputReport, "", acFormatPDF, (myPath & strReportName & ".PDF")
    
    End sub
    It has to be the formatting with the text i have put in bold. But as im no expert in VBA I'm hoping someone could point out where i am going wrong.

    thanks.

  2. #2
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    Code:
    Private Sub Command26_Click()
    
    Dim myPath As String
    Dim strReportName As String
    
    myPath = "G:\1test\"
    strReportName = Me.Quote_ID
    
    DoCmd.OpenReport "QuoteMain", acViewPreview
    DoCmd.OutputTo acOutputReport, "", acFormatPDF, myPath & strReportName & ".pdf"
    This is the working code.

    One day ill know what im doing.

  3. #3
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    To be honest I think there's a slight bug when dealing with PDFs The vast majority of forums seem to be suggesting it Glad you got it sorted though

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 10-21-2014, 12:25 PM
  2. Replies: 4
    Last Post: 12-30-2013, 05:51 PM
  3. The open form action was canceled _ from emad
    By Emad in forum Programming
    Replies: 5
    Last Post: 09-18-2013, 12:28 PM
  4. Replies: 15
    Last Post: 07-26-2012, 02:06 PM
  5. Error: The OpenReport action was canceled
    By francisdm@state.gov in forum Reports
    Replies: 1
    Last Post: 12-14-2011, 01:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums