[dba-Tech] [AccessD] Access Has Stopped Working! (Working Solution)
Rocky Smolin
rockysmolin at bchacc.com
Sat Nov 26 23:21:48 CST 2016
Thank you. I'll check it out.
r
-----Original Message-----
From: dba-Tech [mailto:dba-tech-bounces at databaseadvisors.com] On Behalf Of
Jim Lawrence
Sent: Saturday, November 26, 2016 8:11 PM
To: Discussion of Hardware and Software issues
Subject: Re: [dba-Tech] [AccessD] Access Has Stopped Working! (Working
Solution)
There is a PDF viewer/printer from Mozella that runs on any browser. If you
can not get a PDF file to view and to print check out the following:
https://mozilla.github.io/pdf.js/
With this you might be able to circumnavigate the whole problem. Check out
the demo. All that is needed is the name and the preset directory, of the
PDF file. I understand that Access MDB can call/open to a webpage:
https://support.microsoft.com/en-us/kb/308459#bookmark-4
There is a Demo link, link to download the webcode and a full set of
instruction on how to use it via the GitHub project link.
Jim
----- Original Message -----
From: "rockysmolin" <rockysmolin at bchacc.com>
To: "Access Developers discussion and problem solving"
<accessd at databaseadvisors.com>, "Discussion of Hardware and Software issues"
<dba-tech at databaseadvisors.com>, "Off Topic" <dba-ot at databaseadvisors.com>
Sent: Monday, November 21, 2016 1:53:56 PM
Subject: Re: [dba-Tech] [AccessD] Access Has Stopped Working! (Working
Solution)
Dear List(s):
Well I'm back to trying to solve this problem of "Access has stopped
working". The delay helped by reducing the number of times access stops
working, but still occurs randomly.
So I thought about changing the default printer to a pdf printer and then
changing back to the default. Which works OK except the pdf printer pops up
a dialog box asking what to name the pdf file and where to store it.
Does anyone know of a pdf printer that can be controlled from within Access
so that the name and path of the pdf file can be sent to the printer?
MTIA
Rocky Smolin
Beach Access Software
760-683-5777
www.bchacc.com
www.e-z-mrp.com
Skype: rocky.smolin
-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan
Waters
Sent: Tuesday, November 08, 2016 5:54 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Access Has Stopped Working! (Working Solution)
Hi Rocky,
Glad to hear that something is working!
I do have this working at 3 customers for many years at 0.1 seconds w/o any
errors. 1 second doesn't affect a user much but I'd still try 0.5 seconds.
Hope that works!
Dan
-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
Rocky Smolin
Sent: Tuesday, November 08, 2016 19:19
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Access Has Stopped Working! (Working Solution)
All:
I put the Pause function in and it seemed to work on my machine. But still
have the problem at the client site. It didn't work here at .1 seconds, but
at 1 second it did.
That same dll seems to be in the error log. But I don't find anything on
the internets about it.
Any more ideas?
TIA
Rocky
-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan
Waters
Sent: Wednesday, November 02, 2016 1:29 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Access Has Stopped Working! (Working Solution)
Hi Rocky,
Hi Rocky,
I think Jim is correct.
First, save this as a Public Sub.
'---------------------
Public Sub Pause(Optional sngNumberOfSeconds As Single = 0.1)
On Error GoTo EH
'-- Purpose: This will 'pause' running code so that Access can get
other things done
Dim sngPauseTime As Single
Dim sngStart As Single
If sngNumberOfSeconds = 0 Then Exit Sub
sngPauseTime = sngNumberOfSeconds
sngStart = Timer
Do While Timer < sngStart + sngPauseTime
DoEvents
Loop
EH:
Exit Sub
End Sub
'--------------------------
Next, replace the 2nd DoEvents with Call Pause. I do this in my code but I
didn't think you would need it.
By default, Pause will run a loop of DoEvents for 1/10 of a second.
Again, Good Luck!
Dan
-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
Rocky Smolin
Sent: Wednesday, November 02, 2016 1:49 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Access Has Stopped Working! (Working Solution)
Dan, Et Al:
Here's a clue, maybe. That code didn't work - got the "Access has stopped
working" message. BUT!
When I put a breakpoint into the code before the open query and single
stepped through it (F8), it worked!
So it would seem to be some kind of timing issue?
I did put the DoEvents in like you said:
DoCmd.OpenQuery "qryActiveUser"
DoEvents
DoCmd.OpenReport "rptRentalAgreement", acPreview, , , acHidden DoEvents
DoCmd.OutputTo acOutputReport, "rptRentalAgreement", acFormatPDF,
strRAPDFName, False ', "", acExportQualityPrint DoEvents 'DoCmd.OutputTo
acOutputReport, "rptRentalAgreement", "PDFFormat(*.pdf)", strRAPDFName,
False ', "", acExportQualityPrint DoCmd.Close acReport,
"rptRentalAgreement", acSaveNo DoCmd.Close acQuery, "qryActiveUser"
Any clue here?
TIA
Rocky
-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan
Waters
Sent: Wednesday, November 02, 2016 9:44 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Access Has Stopped Working! (Working Solution)
Hi Rocky,
This is indeed a bug which has been around for years. This is how I handle
it in my system.
'----------------------------
'-- To resolve a 2046 bug in Access (see KB 244695) a software
object must be opened before the 'OutputTo' method is called.
'-- Open any read-only query (this opens a database window
referred to in KB 244695)
DoCmd.OpenQuery "qryGlobalErrors"
'-- Output report from the file it's in
If varObjectType = acReport Then
DoEvents
DoCmd.OpenReport stgObjectName, acViewPreview, , , acHidden
DoEvents
DoCmd.OutputTo acOutputReport, stgObjectName, acFormatPDF,
stgAccessObjectPath
DoEvents
DoCmd.Close acReport, stgObjectName, acSaveNo
Else
DoEvents
DoCmd.OutputTo varObjectType, stgObjectName,
varOutputFormat, stgAccessObjectPath
End If
'-- Close the read-only query
DoCmd.Close acQuery, "qryGlobalErrors"
'----------------------------
Good Luck!
Dan
-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim
Dettman
Sent: Wednesday, November 02, 2016 5:11 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Access Has Stopped Working!
Would be good to get the fault from the event log and then see if it is the
same in each case.
If it is, then your probably tripping over a bug.
Jim.
-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
Rocky Smolin
Sent: Wednesday, November 02, 2016 01:37 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Access Has Stopped Working!
I'll try that tomorrow. Un-commenting the last two parameters of the
OutputTo didn't change the result. Still barfed.
I assume then after the output to you close the hidden report?
Thx
R
-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
David Emerson
Sent: Tuesday, November 01, 2016 10:10 PM
To: 'Access Developers discussion and problem solving'; 'List'; 'Off Topic'
Subject: Re: [AccessD] Access Has Stopped Working!
Hi Rocky,
I had a similar situation. I read somewhere that opening the report hidden
first solves the problem
DoCmd.OpenReport " rptRentalAgreement ", acPreview, , , acHidden
DoCmd.OutputTo acOutputReport, "rptRentalAgreement", "PDFFormat(*.pdf)",
strRAPDFName, False ', "", acExportQualityPrint
I also noticed in the second line above (copied from your code) you have a '
after False - this may cause a problem as well.
Regards
David Emerson
Dalyn Software Ltd
Wellington, New Zealand
-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
Rocky Smolin
Sent: Wednesday, 2 November 2016 5:05 p.m.
To: 'Access Developers discussion and problem solving'; List; 'Off Topic'
Subject: [AccessD] Access Has Stopped Working!
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
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
_______________________________________________
dba-Tech mailing list
dba-Tech at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-tech
Website: http://www.databaseadvisors.com
_______________________________________________
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