Access Crash when Command Button used

  • Thread starter Thread starter mmm_danone
  • Start date Start date
M

mmm_danone

I have a report which is generated from a simple select query, taking
data from 2 tables. If I open the report directly (from the
Objects/Reports list) it runs ok. But if I put a simple command button
on a form to run it...

DoCmd.OpenReport "RPT_labels", acViewPreview

....Access pauses for 5 seconds then crashes. No error messages, or
anything - it just closes down the whole application.

I've tried compact & repair, and also opened a new database and
imported all the items into it, but still get same result. I've
rebuilt the query, the report & command button but all still the same.

If anybody has any more ideas I can try, I'd be glad to hear them.
TIA,

Jon
 
You have established that the report is fine and so is its query, so the
problem has to be with the code or with the names of the object.

1. Name AutoCorrect
Uncheck the Name AutoCorrect boxes under:
Tools | Options | General
Explanation of why:
http://members.iinet.net.au/~allenbrowne/bug-03.html

2. Compact the database:
Tools | Database Utilities | Compact

3. Decompile a copy of the database by entering something like this at the
command prompt while Access is not running. It is all one line, and include
the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

4. Compact again.

Decompiling removes a particular kind of corruption that can be just copied
into a new database when you recreate (the normal way to solve corruptions).
The corruption occurs when the text version of the code (what you see and
edit) does not match the compiled version (what actually runs). IME, it is
quite common, and one of the contributing factors is editing code in break
mode.

General suggesions on avoiding corruptions:
Preventing Corruption
at:
http://members.iinet.net.au/~allenbrowne/ser-25.html
 
Allen,

Thanks for the tips.

I'm using a win2000 terminal, and I think this is what's causing the
problems. When run from a PC on the LAN, (using Access 2002, not 2000
as on the terminal) this report seems to run fine (though it prints the
report directly, rather than just opening it up?!?).
I'll ask for a PC on Monday and all should be ok.

Jon
 
Hi

I had the same problem on hopely I resolved it last night.
Only my situation is different. I have(access 2002 fileformat access 2000)
a startform with tabcontrol and commandbuttons to start a form or report.
On the designmaster all works ok But on the replicaset (access 2000)it
causes access to crash when you push a reportbutton. I discovered unused
code in the form events, removed then and it worked.

Stranger that it only happened on the replicaset and not on the
designmaster?

Herman
 
Back
Top