VBA only when certain forms aren't open

dkmort

New member
Local time
Today, 13:34
Joined
Apr 29, 2009
Messages
11
I am looking for some VBA code that I can implement that will allow me to create an if then statement that would do something like this.

if forms a, b, c, d, e and f are NOT open then
LightboxForm.Hide
end if

Or maybe simpler, which would probably work would be:

if OpenFormCount>1 then
LightboxForm.Hide
end if

This would be attached to an "On Unload" event. I am implementing the lightbox effect, which you can find by googling: microsoft access lightbox, then following the blog entry from nkadesign.com

Pretty schnazzy!!

Thanks for any help with figuring out this VBA code. I think the 2nd may be the better option as I think about it. I'll do some digging to see if I can figure out how to count the number of open forms, but if anyone comes up with this sooner, I'd appreciate a post back here. :-)

Sincerely,
-
Doug
 
Maybe check out the IsLoaded property.

CurrentProject.AllForms("formname").IsLoaded
 
You got it exactly right. I googled it & found it in between my post & just now. Thanks!
 

Users who are viewing this thread

Back
Top Bottom