How to close multiple form instances

phuile

New member
Local time
Yesterday, 23:01
Joined
Feb 20, 2014
Messages
2
After creating multiple instances of a form how should they be closed so as to ensure that all of their assets are disposed of and there are no memory leaks? DoCmd.Close seems not to work because it expects a name string which would be the same for all instances of the form. Since a form's name is a read only property it cannot be modified when the form is created so it doesn't uniquely identify a particular form instance. I've tried setting the form reference to Nothing which appears to work, but I'm not sure whether this is the correct technique and whether it disposes of everything cleanly.
Thanks.
 
What do you mean by instance of a form? Do you mean calling it with a Dim frmName As NewForm statement prior to referencing it in code?

I never do that but was taught it is the proper way. What is the purpose of doing that? I still don't quite understand why it is necessary.

Anyway, if that is what you mean you will probably have better luck in the VBA section...
 

Users who are viewing this thread

Back
Top Bottom