>Hello all. I have a timer that forces our Mere Mortals application to close. To ensure a graceful exit, I need to check for any forms open in the application and possibly call their unload/release etc event.
>
>I have seen goApp.oForms.GetFormCount() used, and a FOR loop as such:
>
>>>FOR EACH oForm IN _screen.Forms
>** do some magic to find form name and close it?
>
>
>I am having issues with a graceful (cannot access selected table errors) exit when simply calling OnShutDown() with an open form.
I'm not familiar with MM in particular, but does it perhaps have a goApp.Exit() method? The sort of thing you're trying to do here feels like something Kevin may have already baked into the framework.
A few other general points:
- if the user has data entry in progress, you may have to revert or roll back any changes made
- sometimes you need to be careful using collections when closing its members e.g. (pseudocode)
lnFormCount = goApp.oForms.GetFormCount()
FOR lnIx = lnFormCount TO 1 STEP -1
goApp.oForms( lnIx ).SomeCloseMagic()
ENDFOR
- for the "cannot access the selected table" error, check Sergey's FAQ#18812
But again, it wouldn't surprise me if MM takes care of all this for you if you call the appropriate method(s).
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up