From: emanning on
I recently upgraded a 2003 mdb to a 2007 accdb. There is one form in
this accdb that causes 2007 to crash after it closes and compacts.
(the standard "M O A has encountered a problem and needs to close...."
message with an option to restart Access) After placing debug
breakpoints in various spots in the code, I've determined that it
crashes Access when the form open event fires but before the first
line of code is executed.

I can use the form repeatedly while the accdb is open. 2007 crashes
only after it's closed. If I don't open this form, the 2007 closes
and compacts normally...no crash.

I took the automatic compact out - no change.

I recreated the form - no change.

This is a good-sized accdb with lots of forms. The coding is all VBA,
there are no macros except for Autoexec to open the main menu form,
and is fairly straight-forward. Nothing fancy going on.

I'm curious if there's some kind of property setting on the form or
accdb that would cause this kind of behavior.

I've been researching this problem online and unfortunately there's a
million reasons why 2007 might crash. I'm hoping that someone has had
a similar problem to mine.

Thanks for any help or advice.
From: Lou O on
On Mar 8, 10:57 am, emanning <emann...(a)kumc.edu> wrote:
> I recently upgraded a 2003 mdb to a 2007 accdb.  There is one form in
> this accdb that causes 2007 to crash after it closes and compacts.
> (the standard "M O A has encountered a problem and needs to close...."
> message with an option to restart Access)  After placing debug
> breakpoints in various spots in the code, I've determined that it
> crashes Access when the form open event fires but before the first
> line of code is executed.
>
> I can use the form repeatedly while the accdb is open.  2007 crashes
> only after it's closed.  If I don't open this form, the 2007 closes
> and compacts normally...no crash.
>
> I took the automatic compact out - no change.
>
> I recreated the form - no change.
>
> This is a good-sized accdb with lots of forms.  The coding is all VBA,
> there are no macros except for Autoexec to open the main menu form,
> and is fairly straight-forward.  Nothing fancy going on.
>
> I'm curious if there's some kind of property setting on the form or
> accdb that would cause this kind of behavior.
>
> I've been researching this problem online and unfortunately there's a
> million reasons why 2007 might crash.  I'm hoping that someone has had
> a similar problem to mine.
>
> Thanks for any help or advice.

Just a thought.
Before Access 2007 you could use custom menus and tool bars on forms.
Is your form perhaps referring to a missing or non existent menu bar?
From: emanning on
On Mar 8, 8:12 pm, Lou O <lgoosterh...(a)gmail.com> wrote:
> On Mar 8, 10:57 am, emanning <emann...(a)kumc.edu> wrote:
>
>
>
>
>
> > I recently upgraded a 2003 mdb to a 2007 accdb.  There is one form in
> > this accdb that causes 2007 to crash after it closes and compacts.
> > (the standard "M O A has encountered a problem and needs to close...."
> > message with an option to restart Access)  After placing debug
> > breakpoints in various spots in the code, I've determined that it
> > crashes Access when the form open event fires but before the first
> > line of code is executed.
>
> > I can use the form repeatedly while the accdb is open.  2007 crashes
> > only after it's closed.  If I don't open this form, the 2007 closes
> > and compacts normally...no crash.
>
> > I took the automatic compact out - no change.
>
> > I recreated the form - no change.
>
> > This is a good-sized accdb with lots of forms.  The coding is all VBA,
> > there are no macros except for Autoexec to open the main menu form,
> > and is fairly straight-forward.  Nothing fancy going on.
>
> > I'm curious if there's some kind of property setting on the form or
> > accdb that would cause this kind of behavior.
>
> > I've been researching this problem online and unfortunately there's a
> > million reasons why 2007 might crash.  I'm hoping that someone has had
> > a similar problem to mine.
>
> > Thanks for any help or advice.
>
> Just a thought.
> Before Access 2007 you could use custom menus and tool bars on forms.
> Is your form perhaps referring to a missing or non existent menu bar?- Hide quoted text -
>
> - Show quoted text -

I thought of that too. I did find a "=1" in the menu bar property,
which is left over from the 2003 version. I took that out but that
didn't solve the problem.

Thanks for your reply.
From: Allen Browne on
Suggestion:

1. Open the from in design view.

2. Open the code window.
Cut all the code out, and save it (with Notepad.)

3. Set the form's HasModule property to Yes (and confirm.)

4. Compact the database.

5. Test if the form now opens without a crash.
Yes: continue on to step 6.
No: continue at step 9.

6. Open the form in design view, and click the ribbon icon to open the
form's module. Paste the code back in. If possible move the code from
Form_Open into Form_Load (i.e. anything that doesn't require you to set
Cancel.)

7. Compile the code (to ensure Access understands it.

8. Test the form. If it's not solved, continue.

9. Make sure Name AutoCorrect is off. Compact. Decompile. Compact again. Set
minimal references and compile. Details of these steps here:
http://allenbrowne.com/recover.html

10. Save the form with SaveAsText. Details:
http://allenbrowne.com/ser-47.html#SaveAsText
Delete the form.
Compact.
LoadFromText.

11. If you are still stuck, something else is wrong.
From here it's divide'n'conquor.
Create the simplest form you can (text boxes only for the fields, no
subforms, no combos/listboxes, no code.) If this still crashes the problem
may be with the source query rather than the form.
Continue to add/subtract things until you pin down the culprit.

Hopefully that sets you on a useful trail to get this solved.



Something else is wrong. Divide the problem down until you can pinpoint the
issue.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"emanning" <emanning(a)kumc.edu> wrote in message
news:4d44b3bb-f6a8-4a2d-9d74-669a5941837f(a)g26g2000yqn.googlegroups.com...
> I recently upgraded a 2003 mdb to a 2007 accdb. There is one form in
> this accdb that causes 2007 to crash after it closes and compacts.
> (the standard "M O A has encountered a problem and needs to close...."
> message with an option to restart Access) After placing debug
> breakpoints in various spots in the code, I've determined that it
> crashes Access when the form open event fires but before the first
> line of code is executed.
>
> I can use the form repeatedly while the accdb is open. 2007 crashes
> only after it's closed. If I don't open this form, the 2007 closes
> and compacts normally...no crash.
>
> I took the automatic compact out - no change.
>
> I recreated the form - no change.
>
> This is a good-sized accdb with lots of forms. The coding is all VBA,
> there are no macros except for Autoexec to open the main menu form,
> and is fairly straight-forward. Nothing fancy going on.
>
> I'm curious if there's some kind of property setting on the form or
> accdb that would cause this kind of behavior.
>
> I've been researching this problem online and unfortunately there's a
> million reasons why 2007 might crash. I'm hoping that someone has had
> a similar problem to mine.
>
> Thanks for any help or advice.