I used this trick on some healthcare software that I did. write one function. You can write a UDF to check if it's loaded, or you can use the built in property of the CurrentProject object. on every object that is relevant in the on close event, put something like:then as a function, loop the opens and check for a count > 1, e.g.-
Code:
dim i as integer, counter as integer
for i = 0 to application.forms.count - 1
if currentproject.allforms(0).isloaded=true then
counter = counter + 1
end if
next frm
if counter > 1 then
'THIS IS NOT THE LAST OBJECT OPEN!
end if
you'll have to do it for reports and forms both, but that's the idea that I came up with when I did it. Kudos to those who find a faster way!