OK,
This is a very common method to determine if a form is loaded:
- If CurrentProject.AllForms("FormName").IsLoaded Then
-
' DO SOMETHING
-
End If
I do know that if the form is a subform, and not loaded as a standalone, and the parent form is opened with the subform loaded then
CurrentProject.AllForms("SubFormName").IsLoaded = FALSE
.
Now I use this in my subforms to check to see if the parent is opened and I cancel the open if the parent is NOT opened to keep the subforms from erroring
SO, if the code, ran as subform on_open, returns false, then we're 95% assured that the form has been opened as a subform and easy to confirm with Neopa's function or any numerous methods.
HOWEVER,
if the result is true then we know that, there is at lest one form with that name loaded as a standalone and it could be the form calling the code or one that was already open as standalone. This is the logical rub...