[dba-Tech] Access Has Stopped Working!

Stuart McLachlan stuart at lexacorp.com.pg
Tue Nov 1 23:40:45 CDT 2016


Try using using  the built in  constant ACFormatPDF or its literal value "PDF"
in place of  your "PDFFormat(*.pdf)"



On 1 Nov 2016 at 21:04, Rocky Smolin wrote:

> Dear List(s):
> 
> 
> 
> I am running an accdb in A2010.  I want to convert a report to a pdf
> and attach it to an email.  This works perfectly on my machine.  
> 
> 
> 
> At the client site it does not. I spent two hours there today trying
> everything I could think of -  checking Microsoft update for patches
> fixes, updates, etc., decompiling, compact and repair, lacing the code
> with DoEvents, running as administrator - nothing worked.  I did track
> the problematic line of code.  It is the line with 
> 
> 
> 
> DoCmd.OutputTo acOutputReport
> 
> 
> 
> And Access Stopped Working on this line of code almost every time.  I
> say almost because a couple of times it ran - generated both pdfs and
> popped up the email with the two report pdfs attached!  Which is why I
> tried the DoEvents.  But it barfed pretty consistently on that first
> DoCmd.OutputTo acOutputReport,
> 
> 
> 
> Here's the code:
> 
> 
> 
> strFrontEndPath = db.Name
> 
> Do While Right(strFrontEndPath, 1) <> "\"
> 
>     strFrontEndPath = Left(strFrontEndPath, Len(strFrontEndPath) - 1)
> 
> Loop
> 
> strRAPDFName = strFrontEndPath & "RentalAgreement-" _
> 
>     & Me.cboNameAndAddress.Column(1) & "-" _
> 
>     & Me.fldRAHOrderNumber & ".pdf"
> 
> strRAPDFName = Replace(strRAPDFName, "*", "")
> 
> 
> 
> DoCmd.OutputTo acOutputReport, "rptRentalAgreement",
> "PDFFormat(*.pdf)", strRAPDFName, False ', "", acExportQualityPrint
> 
> 'Call ConvertReportToPDF("rptRentalAgreement", , strRAPDFName, ,
> False)
> 
> 
> 
> strCCPPDFName = strFrontEndPath & "CreditCardPermission-" _
> 
>     & Me.cboNameAndAddress.Column(1) & "-" _
> 
>     & Me.fldRAHOrderNumber & ".pdf"
> 
> strCCPPDFName = Replace(strCCPPDFName, "*", "")
> 
> 
> 
> DoCmd.OutputTo acOutputReport, "rptCreditCardPermissionForEmail",
> "PDFFormat(*.pdf)", strCCPPDFName, False ', "", acExportQualityPrint
> 
> 'Call ConvertReportToPDF("rptCreditCardPermissionForEmail", ,
> strCCPPDFName, , False)
> 
> 
> 
> 
> 
> You can see the previous legacy code which worked for a long time in
> A2003 - the calls to ConvertToPDF - which I have commented out.  That
> doesn't work anymore.  
> 
> 
> 
> So I'm really stumped.  Has anyone had this problem and found a
> solution? Two martinis to the genius who can post an effective fix.
> 
> 
> 
> MTIA
> 
> 
> 
> 
> 
> Rocky Smolin
> 
> Beach Access Software
> 
> 760-683-5777
> 
>  <http://www.bchacc.com> www.bchacc.com
> 
>  <http://www.e-z-mrp.com> www.e-z-mrp.com
> 
> Skype: rocky.smolin
> 
> 
> 
> 
> 
> _______________________________________________
> dba-Tech mailing list
> dba-Tech at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-tech
> Website: http://www.databaseadvisors.com
> 




More information about the dba-Tech mailing list