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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detect if a Form is open or not

Status
Not open for further replies.

sjn78

Programmer
Feb 22, 2003
92
AU
I have an options box where the user can choose what text boxes are displayed on it.

If the form is open, you can go to the options dialog, make the selections and hit save. This then calls a sub procedure in the form to setup the text boxes to the new settings.

The problem I have is if the form isnt open and you hit save in the options dialog, the form will open when i don't want it to.

Is there a way to find if the form is currently open or should I put this code in a module instead.

Thanks for your help

Steve
 
Checking the forms enabled property will tell you if it is loaded or not.
 
Loop through the Forms collection - only loaded forms are in the collection.

I don't believe that the enabled property does anything except set the form to be enabled or not. You can still load a form with it's Enabled property set False (you just can't do anything with it!)


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
i agree with Johnwm. The enabled property has nothing to do with the state of the form in terms of loaded or unloaded. The form collection method should do the trick.
Qureshi
 
Thanks for all of your help...I havent had a chance to try it out yet though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top