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.
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?