Access 2007 - Can't close form; run-time error 2450

R

rc51wv

I have quite a few forms where in the on close or unload property have the
form closing itself and then making a main menu form visible.

Code:
Forms!FrmMainMenu.Visible = True

When altering these forms and not having the main form open in 2k3, on
attempting to exit it would pop up with the continue/end/debug/help dialouge
box and if you clicked end it would go ahead with the operation of closing
the form and ending the debugger. With 2007, it just closes the dialouge box.
Now we have to either make sure that the main menu form is open or either
completely close and reopen access to change from form view to design view.

Is there a way around this?
 
J

Jeanette Cunningham

Hi rc51wv.
in the unload event for the form, try code like this-->

DoCmd.OpenForm "frmMainMenu"

If frmMainMenu is not open, that code will open it.
If frmMainMenu is already open, it will become visible.
There should not be any errors with this one line of code.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top