Error when closing form

jcaptchaos2

Well-known Member
Joined
Sep 24, 2002
Messages
1,029
I have a form that opens and it askes you to put some information in, if you don't put any information in and close it it gives a "The openForm action was canceled". "You used a method of the DoCmd object to carry out an action in Visual Basic but then clicked cancel in the dialog box. For example, you used the Close method to close a changed form, then clicked cancel in the dialog box that asks if you want to save the changes you made to the form" Is there a way to make it so you don't get that warning?
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,452
Office Version
  1. 365
  2. 2021
  3. 2016
Platform
  1. Windows
Is there an on close VBA event for this form? If so then I think you will find your problem there. If not, is this form closed by cliking a custom button or the little "x" at the top right of the screen?

Andrew
 

jcaptchaos2

Well-known Member
Joined
Sep 24, 2002
Messages
1,029
Andrew, thanks for responding. There is no close event on the form and it is closed by clicking the red X in the corner.
 

jcaptchaos2

Well-known Member
Joined
Sep 24, 2002
Messages
1,029
Actually what is causing the error is the message box that opens when you click the button on the form. If you try to close that message box with out entering any information you get that error when clicking the red X
 

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,452
Office Version
  1. 365
  2. 2021
  3. 2016
Platform
  1. Windows
Hi

It sounds like there is something going on......but I can't visualise what that is. Do you want to send me a zipped copy of your database?

Andrew
 

Forum statistics

Threads
1,181,053
Messages
5,927,848
Members
436,573
Latest member
CMR237

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top