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

Finding unloaded Forms 1

Status
Not open for further replies.

pmcdaniel

Programmer
Feb 9, 2007
127
US
When I close my MDI application I save all forms which are showing so I can have them show again the next time the application is opened.

Code:
varUtilitySettings = GetAllSettings(appname:="My Utility", Section:="Open Forms")

  For bytCounter = LBound(varUtilitySettings, 1) To UBound(varUtilitySettings, 1)
 varUtilitySettings(bytCounter, 1)
      For Each objForm In Forms
        If objForm.Name = varUtilitySettings(bytCounter, 1) Then
          objForm.Show
          Exit For
        End If
      Next 'objForm
  Next 'bytCounter

This, however, does not work because the forms are not loaded and it appears I can only use the above "For Each" loop on loaded forms. Is there a way for me to find all forms in my VB project whether already loaded or not without hard-coding each form name?

thanks
 
Just to clarify, TysonLPrice's Forms.Add solution (a variant of the FormByName function that I have previously posted to this forum about 6 years ago thread222-795815) does resolve the OP's originally stated problem.

It was the solution to getting all the project form names that I was taking exception to.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top