We help IT Professionals succeed at work.

Problems stepping through VB code in On Close event with Access 2007 database

newbie46
newbie46 asked
on
265 Views
Last Modified: 2012-05-11
When the user exits the database (via the frmMainMenu Exit button or hits the X at the upper right corner of the database), I prompt the user with a yes/no question. If they click Yes, I want specific VB code to be processed. I have added this code to frmMainMenu's On Close event. The VB code needs to access controls on frmMainMenu. I am having 2 problems:

1) frmMainMenu closes prior to the prompt being display,  and, as a result, the VB code cannot access the needed controls, since frmMainMenu has closed.
2) I cannot step through the code in the On Close event to make sure that it is working. After clicking Yes from the prompt, it closes the database and does not stop at the break point that I have set.

My questions:
1) How can I prevent frmMainMenu from closing until after the VB processing is complete?
2) How can I step through the On close event code to make sure that it is working correctly?

thanks.
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2016
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.