Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find active UserForms 1

Status
Not open for further replies.

daseffects

Technical User
Aug 21, 2003
38
GB
I have a few forms which are shown based on various triggers. WHat I would like is a way to see which userforms are open and the unload them.

I've tried just stating

unload Userform1
unload Userform2
unload Userform3

But I get an error message if one of the forms has already been closed. I couldn't find and active userform commands.

Thanks for any help on this.
D

 
Try this:

Code:
On Error Resume Next
unload Userform1 
unload Userform2
unload Userform3

This way, you don't have to know which User Form is loaded. If your code causes an error on one line it simply goes to the next line of code.

I hope this helps!



Peace! [peace]

Mike

Never say Never!!!
Nothing is impossible!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top