Msg: Access has stopped working (1 Viewer)

fernando.rosales

Registered User.
Local time
Today, 01:46
Joined
Jun 11, 2014
Messages
27
I have a database that runs everyday and does the exact thing everytime. It runs a query and exports a couple report to my C drive. I cant explain why sometimes it crashes when it gets to the export vba line and crash with a "Microsoft Access has stopped working". This issues does not happen all the time either (I would say 50% of the times). I have the exact same database in another pc and this has no issues, just this one. Does anybody know if it may be something with the pc that makes this crash.

Code:
Rptnamedd = "DD's Release FIFO 1st Shift Start"
strFolderPath = "C:\RossApps\Mark_Release_FIFO\MVDD\"
DoCmd.OutputTo acOutputReport, "Release FIFO_DD", "PDFFormat(*.pdf)", strFolderPath & Rptnamedd & ".pdf", False, "", 0
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 03:46
Joined
Feb 28, 2001
Messages
27,515
If it crashes intermittently then it is important to be aware of what ELSE might be going on at the same time. It is also important to perhaps manually open the report just before you trigger this code to see if a manual launch crashes, too.

This is a case of "hide and seek" and so far, your bug is hiding. My two suggestions are two ways to seek.

Other factors:

How big is the database?
Has it been compacted & repaired lately?
How much free space do you have on your C drive?
How big is your page file? (To get that, you can go to Start>>Accessories>>System Tools>>System Information.)

I'm sure I'll think of something else to ask. Most of these system tests are elimination tests for the quickest, easiest things to address. To be honest, I doubt they will return anything of significance, but if I don't ask and it was one of these factors, I'll kick myself later for not eliminating the obvious.
 

fernando.rosales

Registered User.
Local time
Today, 01:46
Joined
Jun 11, 2014
Messages
27
Hi Doc, I have also tried to open the report manually and sometimes it crashes. Funny thing is, it might open good one time but if I try again it crashes and I get the same message. It happens on and off, frustrating.

The database is only 3 MB. The database has compact on close and I have also tried doing compact and repair and trying again but same issue.

C drive has 319 GB of free space. Page file is 3.41 GB.

This must be something with this pc because it works fine in others.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 03:46
Joined
Feb 28, 2001
Messages
27,515
You have, in essence, eliminated a LOT of things external to the database. (Which is good, by the way, because it drastically narrows the playing field.)

The fact that it sometimes crashes when you manually open the report means that the problem isn't in the code that launches the report. It is EITHER the data driving the report or it is the report structure itself. Intermittancy makes me think it is data-centric, but there is still an outside chance of something else.

We are looking for reasons why a report might blow up. So we have to look at all of the levels of things that contribute to the creation of the report on-screen. This kind of debugging is tedious, but if you aren't getting any error messages of value, it is the only way I know to narrow it down.

By any chance, does the report have a class module with some report formatting or statistical code in it?

Do you have warnings turned off in your database? If so, turn them on again for the purpose of debugging.

Is there a named query that is the recordsource of your report OR did you build the report from scratch using the report wizard, which will build a query for you?

A) If there IS a named query, can you open that query and, if so, do you see any oddball characters, <NULL> cases, or anything like #name, #value, or some other hash-tag note in one of the fields in the query?

B) If there is NOT a named query, can you open the .Recordsource of the report, copy that query, use the query designer in SQL mode, and MAKE a named query out of it, then apply the previous test? (What you want is to be able to see the data stream that is feeding the report.)

Out of curiosity, when you manually open the report and it crashes, can you go back and bring it up in Print Preview mode, then step through the pages until it crashes? If so, trial and error might let you localize it to a record or group of records. If it crashes immediately in Print Preview, that doesn't tell us much, but if it crashes on a later page, that tells us A LOT.

There is one other thing we can try that might help. It's a long shot, but heck, if it pays off we can narrow stuff down really well. If your version of Windows has a clock gadget for the desktop, enable it. If/when Access crashes on your report, immediately note the time on the gadget.

Here is the long shot: Open Control Panel >> Administrative Tools >> Event Viewer. You will have the option to view several event log streams. For Win7, you can see under WINDOWS logs; look in the SYSTEM, APPLICATION, and SECURITY logs. Under Applications and Services logs, look in the ACEEventLog and the Hardware Events.

ONLY look for events at the date & time you noted when the report crashed, no more than two minutes either way of that time. Since both the clock gadget and the event logs take their times from the same internal source, the time you noted on the gadget will correspond to times in the event logs. What you are looking for is something that occurred at or within several seconds of the application crash. If you get more than two minutes away from the event with no results, it ain't there to be found.

You will probably see a task or process exit. You MIGHT see some other errors. If you do, there will be a status code of some type that might or might not be translated to text. If it says something about MSACCESS.EXE exiting or aborting, that is a significant event log and might be relevant to the problem.

If you can't find anything like that, it is OK because Access can crash in other ways. But if you get lucky, it crashed in a way that left behind a trail. In which case we need to know the exiting status code, which will start with 0x8 plus 7 more hexadecimal digits. You probably won't see a 0xC plus 7 more digits because the 0xC... errors usually cause a Blue Screen of Death.
 

Cronk

Registered User.
Local time
Today, 18:46
Joined
Jul 4, 2013
Messages
2,777
Is the database, either front end or back end, running on a network where there are short disruptions?
 

Users who are viewing this thread

Top Bottom