none
docmd.OutPutTo quit working, need pointers for PrintOut RRS feed

  • Question

  • I had a process where an Access report was printed/saved to a PDF file via docmd.OutPutTo, and it was working fine until last week.   My printer I was using was BullZip.  Then it started hanging up and crashing the program and now won't work at all.  I'm working remote with my client,  across the country, and they can't think of anything that changed.  I've researched the OutPutTo crashing, and it seems to be a known bug with no resolution from MS.

    I'm trying to switch the process to use PrintTo, but code I found on the net seems to have some gaps in it or something, or it plain does not work to begin with.

    This is the code I found, but it blows up when I try to address the Doc object.  This code never defines/dim the Doc, so I'm not sure what is going on or what it is I'm supposed to be talking to.  From what I'm reading, a Document object does not deal with an Access report object.  Can anyone point me to some working code, or  give me ideas to adapt this?

    Sub PrintInvoice(Optional sFileName As String = "", Optional confirmOverwrite As Boolean = False)
        Dim oPrinterSettings As Object
        Dim oPrinterUtil As Object
        Dim sPrintername As String
        Dim sFullPrinterName As String
        Set Doc = ActiveDocument
        Set oPrinterSettings = CreateObject("Bullzip.PdfSettings")
        Set oPrinterUtil = CreateObject("Bullzip.PdfUtil")
        sPrintername = oPrinterUtil.DefaultPrintername
        oPrinterSettings.Printername = sPrintername
        With oPrinterSettings
            .SetValue "Output", sFileName
            .SetValue "ConfirmOverwrite", "no"
            .SetValue "ShowSettings", "never"
            .SetValue "ShowPDF", "no"
            .WriteSettings True
        End With
        Doc.PrintOut
    End Sub


    Thanks, David


    • Edited by David_Ford Monday, January 14, 2019 5:35 PM
    Monday, January 14, 2019 5:34 PM

All replies

  • Hi David,

    What version of Access is your client using? What does your OutputTo code look like?

    Monday, January 14, 2019 5:52 PM
  • Access 2016.

    DoCmd.OutputTo acOutputReport, "WT Report", acFormatPDF, filePath, False

    "WT Report" is the name of the report.

    filePath is this full file path and name to print to.

    This was working fine for a couple of weeks.  I tried it last Thurs or Fri and it just bombs.

    I see that it creates .TMP files in the subdirectory, but doesn't do more than that before it crashes.


    Thanks, David


    • Edited by David_Ford Monday, January 14, 2019 8:47 PM
    Monday, January 14, 2019 8:44 PM
  • Hold up.  Something might be wrong with the report itself.

    Thanks, David

    Monday, January 14, 2019 8:49 PM
  • Access 2016.

    DoCmd.OutputTo acOutputReport, "WT Report", acFormatPDF, filePath, False

    "WT Report" is the name of the report.

    filePath is this full file path and name to print to.

    This was working fine for a couple of weeks.  I tried it last Thurs or Fri and it just bombs.

    I see that it creates .TMP files in the subdirectory, but doesn't do more than that before it crashes.


    Thanks, David


    Hi David,

    If not the report, I wonder if you were affected by some update from MS.

    Monday, January 14, 2019 9:24 PM
  • Right now looking like a field that is in a table that is being imported has changed data type from numeric to text, and I have to deal with that first.  I'll know later whether this was all a false alarm.  Probably is.  Thanks for now.

    Thanks, David

    Monday, January 14, 2019 9:34 PM
  • Good luck!
    Monday, January 14, 2019 10:30 PM
  • Problem was not the OutputTo command, as I feared at first.  that was just where it blew up.  The problem was further back in the data (external data field definitions changed), and that was the first point where it made itself known.

    Apologies for wasting your time. 


    Thanks, David

    Tuesday, January 15, 2019 1:13 AM
  • Hi David,

    No worries. Glad to hear you got it sorted out. Cheers!

    Thursday, January 17, 2019 10:53 PM