Once the form is in design view it will close without running any code
When the error happens, you have a message with four buttons as posted in #1.
Continue, End, Debug, Help.
Continue is grayed out. End stops the code from continuing but leaves the form open. Debug, puts you in design view with the error highlighted.
Help is useless.
So, continuing on the Debug option since none of the other three do anything even remotely helpful. I stop the code from running. That should allow me to close the quiescent form. It does not. The issue seems to be that the failing code is in the Unload event which Access insists on running.
I KNOW THAT I CAN STOP THE CODE FROM RUNNING if I comment it out. How many times do I have to say that? I hear you. I hear you. I hear you. Once the code is stopped, I think I should just be able to close the form without running ANY code. You disagree. OK, you disagree. I hear you. I hear you. I hear you. Thank you very much for your contribution. There is no reason to continue this circular conversation. Thank you. Thank you. Thank you. Can we please be done with this part of the lesson.
What we have learned from this discussion is that if you have any code in the Unload event, no matter how innocuous or how unlikely to fail, you MUST include error handling or you will never, ever be able to get past an error raised that that particular event. This may also apply to other events that run during form shut down. You end up with no graceful way to close the form. You MUST get rid of the failing code or use Task Manager to close the form. So, even if there is technically nothing wrong with the code, meaning the fix is something external to the form, you still MUST change code somehow to keep the failing instruction from running because Access can't take a joke and will NEVER let you close this form as long as the error is not removed. PERIOD. So, even though in my case, I initially thought I needed to import another form, I couldn't exit to fix the problem without modifying code that didn't need to be modified. Very friendly MS.
Ah Ha,
@Josef P. has actually found the solution. He found a magical sequence of keystrokes which if executed in the described order, gets past the problem. Thank you Josef. But it shouldn't have been so hard to get out of this stupid loop.