R
rdemyan via AccessMonster.com
I have a form with a close button on it. When the close button is clicked I
want the entire application to close.
In the Form_Close event I have code that does some cleanup and then uses
DoCmd.Quit (I've also tried Application.Quit) to shut down the application.
In the close button click event I have the following line of code:
Call Form_Close
When I click the 'X' on the form control box, everything closes just fine.
I've walked through the code and doing this definately causes the Form_Close
event to be executed.
When I click on the Close button on the form (not in the control box), the
Form_Close event gets called and the code is executed. However, when DoCmd.
Quit (or Application.Quit) is encountered an error occurs:
"Invalid Procedure Call or Argument"
But the app shuts down anyway after the message box with the error message is
closed.
So to sum up, the Control Box 'X' works fine, but a 'Close' button on the
form leads to this error. Presumably both use the exact same code to clean
up and then close the app.
Any ideas???
want the entire application to close.
In the Form_Close event I have code that does some cleanup and then uses
DoCmd.Quit (I've also tried Application.Quit) to shut down the application.
In the close button click event I have the following line of code:
Call Form_Close
When I click the 'X' on the form control box, everything closes just fine.
I've walked through the code and doing this definately causes the Form_Close
event to be executed.
When I click on the Close button on the form (not in the control box), the
Form_Close event gets called and the code is executed. However, when DoCmd.
Quit (or Application.Quit) is encountered an error occurs:
"Invalid Procedure Call or Argument"
But the app shuts down anyway after the message box with the error message is
closed.
So to sum up, the Control Box 'X' works fine, but a 'Close' button on the
form leads to this error. Presumably both use the exact same code to clean
up and then close the app.
Any ideas???