Solved

Load all forms

Posted on 1998-09-15
8
151 Views
Last Modified: 2010-05-03
I have an MDI form and about 70 forms in it (Yes i know i'm crqzy) the story is that i need to load all of them at start up or a method to refare to them even when they are not loaded, The Forms collection contain only loaded forms and i realy dont want to start typing 70 lines of load X, Load Y, Load M etc.
I need an answer ASAP, Please my job depends on it, Thank you.
0
Comment
Question by:DarkAge
8 Comments
 
LVL 14

Expert Comment

by:waty
ID: 1435024
One solution is naming your forms mdiChild(0) ... mdiChild(69)
and do
 for  nI = 0 to 69
    Load mdiChild(nI)
 Next
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1435025
I think that "70 lines of load X, Load Y, Load M" may be the only way out. How can the app know the list of forms that you want until it's told?

You might be able to make a data structure in a disk file or something with the list of forms to load, but that is cumbersome. You CAN load a form from a variable.

'Form1 Code:
Private Sub Form_Load()
    Text1.Text = "Form2"
End Sub

Private Sub Command1_Click()
    LoadFormByName Text1.Text
End Sub

Private Sub LoadFormByName(sFormName As String)
    Dim NewForm As Form
    Set NewForm = Forms.Add(sFormName)
    NewForm.Show
End Sub

You still have the problem of generating the list of forms to load. Maybe you could make a copy of the .VBP file and use that?

M
0
 

Expert Comment

by:idcjavateam
ID: 1435026
We normaly use a the form.count method to unload all forms.
I do suppose, that you could use it to load them all.


0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 12

Expert Comment

by:mark2150
ID: 1435027
He can't use form.count as the count is zero/one since they haven't been loaded yet!
0
 
LVL 1

Author Comment

by:DarkAge
ID: 1435028
I cant give a form name with ( ), Sorry
0
 
LVL 1

Author Comment

by:DarkAge
ID: 1435029
Hey mark2150, U'r answer is the one and it's wounderfull thanks, But it looks like it's locked for the other one who was mistaken, I want to grant you the points, You realy saved my neck man, thanks - How can i unlock it and give you the points?

0
 
LVL 12

Accepted Solution

by:
mark2150 earned 220 total points
ID: 1435030
Easy enough - gimme the points for *this* answer (grin!)
M
0
 
LVL 1

Author Comment

by:DarkAge
ID: 1435031
Ten Four, Out.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA Word macro - how to get characters after the searched for string 5 85
VBA saving file message display 5 67
Help me. 3 56
Automatic Email Reminder 4 38
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question