You could consider removing the application close button so that your own button is the only way to close the db without resorting to pulling the plug or invoking Task Manager. The button code could log somebody out, in which case you can see who logs in but sometimes/always doesn't seem to log out.
My guess would have been that forms are closed in the reverse order to which they're opened when using the application close button. However, it could be that the speed at which things occur can be such that one time, a form is closed by Access before the code in another one can complete, and that code is related to some form that's already closed. As a general rule, I would always open such hidden forms first, then a main form.
Apparently you can create a class module and tie the application object to it, although I'm not sure if the list of application methods or properties includes one that will allow you to prevent the application from closing. I supposed you could also iterate over the AllForms collection to see if any are open and decide what to do based on that. What you haven't said is what you're trying to achieve with your current setup. Maybe you don't really need to control the order of closing forms at all.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.