• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 625
  • Last Modified:

Access 2007 - Error on exiting database

I have just started to run a older Access 2003 database in Access 2007.  When I exit the database I get the following error:

"Microsoft Office Access has encountered a problem and needs to close.  We are sorry for the inconvenience."

This is the only database that this error is occurring.  (It is a split database.)
(I have attached the image with the error signature report information in Figure 1.)
A2007-Close-Error.jpg
0
shrimpfork
Asked:
shrimpfork
  • 21
  • 7
  • 5
  • +3
6 Solutions
 
TorrwinCommented:
My first guess would be that you have some VBA code that is attempting to run when the database closes, and this code wasn't tested with Access 2007.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
First, try a Compact and Repair on the MDB.

mx
0
 
Rey Obrero (Capricorn1)Commented:
from the VBA window do,
Debug >Compile

correct any errors raised
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
shrimpforkAuthor Commented:
Torrwin,
This happens even if I'm in the program, do some work on a form and then use the red X to close the project after I save it.

DatabaseMX,
I have run a compact and repair on the database. No luck.
0
 
shrimpforkAuthor Commented:
capricorn1,
I have run the Debug>Compile...no errors.
0
 
Rey Obrero (Capricorn1)Commented:
also try decompiling the compile

http://www.granite.ab.ca/access/decompile.htm
0
 
TorrwinCommented:
>>This happens even if I'm in the program, do some work on a form and then use the red X to close the project after I save it.

So, do you mean that this error occurs at design-time?
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Import ALL objects into a brand new MDB or ACCDB.

mx
0
 
shrimpforkAuthor Commented:
capricorn1,
I just decompiled and recompiled the DB. The error still is present on exit. It did reduce the size of the database by 2 MB!
Torrwin,
Yes this error can happen at design time after I have opened the main form, made changes, saved it and exit the program.  It ALSO happens when all the users use the program and exit.
0
 
Rey Obrero (Capricorn1)Commented:
you may have a corrupted form. try recreating the form.
0
 
shrimpforkAuthor Commented:
DatabaseMX,
>>Import ALL objects into a brand new MDB or ACCDB.

Ouch....not easy.  I have user security attached to all the differant forms.  Does that import over in A2007?
0
 
shrimpforkAuthor Commented:
I do get the following error in the Event Log when I exit.
On-Exit-Error.jpg
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
"Does that import over in A2007?"
You mean ULS ?
ULS is not available in an ACCDB.

mx
0
 
shrimpforkAuthor Commented:
capricorn1,
This is no easy form to recreate. (See attached screen shot, Figure 3.)  I would like to avoid it if I can.

Form-Screen-Shot.jpg
0
 
TorrwinCommented:
>> I would like to avoid it if I can.

Just to knock off one more easy thing, do you have all available updates for Access 2007 installed?
0
 
shrimpforkAuthor Commented:
DatabaseMX,
I'm not ready to go to A2007 with this DB yet.  I still need to test a few things.  I nee to get it running as a 2003 version under A2007 first.  I did not know about ULS not avaliable in A2007.  That is going to be another issue for me to look into.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
0
 
shrimpforkAuthor Commented:
Torrwin,
Good question...yes have all the latest updates.
0
 
Rey Obrero (Capricorn1)Commented:
you can first save the form as text file, then load again using vba.
0
 
shrimpforkAuthor Commented:
capricorn1,

>>you can first save the form as text file, then load again using vba.

I have not done this before. Can you expand on a proper procedure?
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
shrimpfork:

We have pretty much given all the  usually possible fixes for this kind of issue.  Maybe a 50/50 change importing into a new MDB would fix it.  If you've done Compile, Decompile, Compact & Repair ... I would really try a repair service.

mx
0
 
shrimpforkAuthor Commented:
I just did try to change the Options to open a differant form other then the main startup form on startup.  It opened and closed WITHOUT any errors.  It must be something in my main form.
0
 
TorrwinCommented:
Do you have a backup copy you can test?
0
 
Rey Obrero (Capricorn1)Commented:
place this codes in a module or just run in the immediate window

sub exportform()
application.saveastext acform, "FormX","c:\FormX.txt"

end sub

to get the form ( rename or delete the existing form first, before running the codes below)

sub ImportForm()
application.loadfromtext acform, "FormX", "c:\FormX.txt"

end sub
0
 
shrimpforkAuthor Commented:
Torrwin,
Yes this database is a split database where the front end is a beta version and it deployed to the users when I set it to copy on the users computer startup. So yes I can test. What do you want me to test?
0
 
TorrwinCommented:
Was just thinking if you had a version that was a bit older, the problem with your form might not have corrupted yet.  Try opening an older version in Access 2K7.
0
 
shrimpforkAuthor Commented:
Experts,
I think that I have narrowed it down to one paticular subform (frmProjectNotesSubform) on my the main form (frmProjectInfo). If I remove the subform, the DB opens and closes without any error. This paticular subform has VB code that tracks the location of the users cursor for entering notes with "Autotext Buttons". (See Figure 3 Above).

Torrowin, you may be onto something with your original comment. I'm going to try to comment out this code and test. Stand by.
capricorn1,  I have not tried your suggestion yet.  Let me see if it is the code first.
0
 
shrimpforkAuthor Commented:
I have commented out the code in the subform (frmProjectNotesSubform). No change.
I did discover something interesting...the subform (frmProjectNotesSubform) has two subforms within it (frmProjectNotesEntrySubform & frmProjectNotesHistorySubform). If I delete these two subforms within the initial subform on the main form, then there are no errors on exit. Further more, if I change the database to open the 1st level subform with these two subfoms with the initial subform, the database closes without errors. It looks as if there is a problem with the main form that consists if a couple 2nd level subforms.

I hope you can follow this. :)
0
 
shrimpforkAuthor Commented:
OK Experts...check this out.  I was able to export the information into a test database, attached as Example 1.

I created a new blank Main Form (frmMain) and dropped in the 2 level subform into it (frmProjectNotesSubform).  If you open the main form (frmMain) it will give you and error on exit. If you open the subform (frmProjectNotesSubform) you will not get any error on exit.  I have attached the database. See if you have the same behavior.

Really interesting, if you open the frmMain and then close the form before you exit, it still gives you an error on exit. It is something with the 2nd level subforms.
Subform2-Test.mdb
0
 
Rey Obrero (Capricorn1)Commented:
cannot reproduce the error. (using A2007)
no error
0
 
shrimpforkAuthor Commented:
capricorn1,
Ummmm....interesting.  I have 5 stations showing the same result here.  Let me double check my WSUS server about A2007 updates.  I would be interested if anybody else can reproduce the error outside our environment.
 
0
 
mbizupCommented:
shrimpfork,

I get the error...

Why are you using frmProjectNotesSubform as an "intermediate" subform between your mainform and your two subforms?

I get the error with this scenario, but placing the two subforms directly on the mainform (linked to the mainform by projectID) seems to resolve the error.
0
 
mbizupCommented:
Everyone here has mentioned corruption.

From what I can tell, the intermediate form (frmProjectNotesSubform) that you are using to "frame" your two subforms is corrupted, and that only seems apparent when you add the master-child links.

Either placing the two subforms directly on the main form or creating a new blank form to replace frmProjectNotesSubform should do the trick for you.
0
 
harfangCommented:
No error either using Access 2003 directly. -- (°v°)
0
 
mbizupCommented:
<using Access 2003 directly>

Just clarifying, I was using Access 2007. I received the error several seconds after closing the Access main window.
Cap1 was using A2K7 with no error as well. I wonder if we were using different SP's? I can't check that until later tonight.
Creating a new intermediate subform or getting rid of it altogether definitely resolved the error for me.
0
 
shrimpforkAuthor Commented:
I checked my updates and there is nothing that I needed.  So I would have to assume that I am up to date.
mbizup,
I'm glad to hear that you also saw the error.  I'm going to try your suggestion now.  I'll let you know.  (Yes this error only happens when the database is opened in A2007, in A2003 it is fine.)
0
 
shrimpforkAuthor Commented:
mbizup,
Your suggestion did not initially work for me.  But it did help me find the EXACT issue.  When I recreated the subform (frmProjectNotesSubform) and dropped in the two other subforms (frmProjectNotesEntrySubform & frmProjectNotesHistorySubform) I went through and set all the properties of the new frmProjectNotesSubform to match the old form. Including setting the property Model = YES.  (Even though it was not required for a subform.)  I discovered that the new subform still produced the same error.  So I went in and changed the property of the OLD subform (frmProjectNotesSubform) Model = NO....no error.  If I change it back to YES...then error.

I remember now why it was originally set to Model = YES, is because that entire subform use to be its own popup form. I moved it into the main form and never changed the Model = NO.

Anyway test it on your end and let me know what you get.
0
 
shrimpforkAuthor Commented:
I meant Modal = YES in the post above...nice.
0
 
shrimpforkAuthor Commented:
BTW: I'm running version Access 2007 (12.0.6423.1000) SP2 MSO (12.0.6425.1000)
0
 
mbizupCommented:
< Model = NO....no error.>

WOW!

That definitely did the trick for me as well, and is something I wouldn't have thought of in a million years!  

You should go ahead and accept your own solution as an answer on this one  (nice job!).
0
 
Rey Obrero (Capricorn1)Commented:
who would thought about that a subform modal property is set to yes????
0
 
shrimpforkAuthor Commented:
mbizup,
Thank you...I got lucky.  But this should not be causing a problem if a subform is it is set to Modal = YES.  What is also very strange is that it also causes the error even if you close the form before you close the program.  Is this a bug?  
0
 
shrimpforkAuthor Commented:
capricorn1,
Funny setting for a subform...huh?
0
 
harfangCommented:
Absolutely, it should not. All windows properties should be those of the main form only. I'm guessing that the order of events has been change just so little (in order to speed up the display), and that the subform has the time to create a void hidden modal window before being caught by the main form. That would crash most programs... Anyway, it's a BUG.

Good job in reacting when you saw that property!

(°v°)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 21
  • 7
  • 5
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now