I am looking for a way to close all open forms through VBA. I have an application that contains many forms, only one of which should be open at any point in time.
Does anyone have any code suggestions on how to accomplish this, either globally or module by module? I have found that I can only execute Docmd.close …. in certain events, specifically in the After Update for a control. In most other events, I get a runtime error 2585 (??). I’m unclear as to when one can and cannot close a form. Would appreciate clarification on this.
Thanks.