In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
What I would do is create a global method and call it from the Private Sub Form_Close() passing only the name of the current form (Me.Name) to it.
This would then create a loop for each of the forms and check if they are open or not. if no forms are open then call the close database method.
Dim f as form
dim chkBool as boolean
chkBool = false
for each f in Forms
if f.Name <> ClosingFormName then
if fIsLoaded(f.Name) then
chkBool = false
end if
end if
next f
if chkBool = false then
DoCmd.Close
end if
Function fIsLoaded(ByVal strFormName As String) As Boolean
fIsLoaded = false
If SysCmd(acSysCmdGetObjectSt
If Forms(strFormName).Current
fIsLoaded = True
End If
End If
End Function