General information
Title:
Problem closing all forms on shutdown
I have a procedure that is called on shutdown. One thing it does is attempt to close all open forms. The problem I am having occurs when it tries to close a form that has opened a modal form.
The code I am using to close the forms is as follows:
FOR i = _screen.formCount TO 1 STEP -1
_screen.forms[i].release
NEXT
I get the error "Cannot clear the object 'myobjectname' because it is in use. Whatever object on the form that called the modal form is the object that gives the problem.
For instance, if my edit button named "cmdEdit" calls a modal form in the click method I would get the message "Cannot clear the object 'cmdEdit' because it is in use. I have even tried referencing the modal form and closing and releasing it before releasing any other forms but that does not seem to help.
If I close the modal form or don't open it at all everything works fine. It seems like there is some sort of reference that the modeless form that calls the modal form is hanging onto.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only