Re: Code window Crashes!
- From: John Spencer <spencer@xxxxxxxxxx>
- Date: Mon, 06 Jul 2009 14:41:21 -0400
I wouldn't expect a crash from this, but do you have a form open that has a timer event running? If so, everytime the timer event is tripped the focus moves from the VBA window to the open form.
First experiment is to try to launch your database while holding down the shift key. Then switch to VBA and try to enter something. If the crashing stops, you know the culprit and will have to find the form that is loading and disable it while you are working in VBA.
You might, at this point, have a corrupted database (or at least corrupted VBA), take a look at the following
From: Allen Browne
Okay, so something has gone haywire with this database. Suggestions to recover it:
1. Make a backup copy of the mdb file, without overwriting any existing backups, in case something goes wrong.
2. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect Explanation of why:
http://allenbrowne.com/bug-03.html
3. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact
4. If the tables are attached, open the data file, and repeat steps 1 - 3 for that file as well.
5. Close Access. Decompile 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"
6. Open Access, and compact again.
7. Open a code window.
Choose References from the Tools menu.
Uncheck any references you do not need.
For a list of the ones you typically need in your version of Access, see:
http://allenbrowne.com/ser-38.html
8. Still in the code window, choose Compile from the Debug menu.
Fix any errors, and repeat until it compiles okay.
9. Compact again.
At this point, you should have a database where the name-autocorrect errors are gone, the indexes are repaired, inconsistencies between the text- and compiled-versions of the code are fixed, and reference ambiguities are resolved.
If it is still a problem, the next step would be to get Access to rebuild the database for you. Follow the steps for the first symptom in this article:
Recovering from Corruption
at:
http://allenbrowne.com/ser-47.html
'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
Ambyr via AccessMonster.com wrote:
I am pulling my hair out on this one....
I've seen similar posts, but none of the solutions fixed my issue.
My database works perfectly, calls all macros, code, etc with no problems.
The only issue I have is when I am adding or updating the VBA code, I get a
fatal crash. I type "Dim MPart as " and get a crash.
I type "me." and get a crash.
However, type me.Mpart = me.PicMonth in word, and then paste it into the VBA,
all works well, and the code window will even change the lower case me's to
proper Me...
I've tried uninstalling and reinstalling, i've tried updating and getting all
hotfixes and patches/service packs; to no avail! it is not specific to this
database, i just created a brand new one, with only one table (and only 2
fields), made the form, switched to VBA window, typed me. and watched it
crash, again.
Please help, this is driving me out of my mind!
- Follow-Ups:
- Re: Code window Crashes!
- From: pyxi_styx via AccessMonster.com
- Re: Code window Crashes!
- References:
- Code window Crashes!
- From: Ambyr via AccessMonster.com
- Code window Crashes!
- Prev by Date: Re: How do I use a combo box to input data into two text boxes on
- Next by Date: Re: Runtime error 2001
- Previous by thread: Code window Crashes!
- Next by thread: Re: Code window Crashes!
- Index(es):
Relevant Pages
|