Solved

Multiple instances of a form?

Posted on 2004-09-12
4
270 Views
Last Modified: 2010-05-02
Is it possibvle to have multiple instances of the same form in a project? Can I program one mdi child form so that i can call it to spawn multiple instances with different variables inside the main form? Thanks.
  - Dave
0
Comment
Question by:User501
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 19

Accepted Solution

by:
Shauli earned 225 total points
ID: 12041005
After you create the first child form, you can do:

'assuming the child form name is Form1

Dim myForm As Form1
Set myForm = New Form1
myForm.Show


S
0
 
LVL 10

Expert Comment

by:anv
ID: 12041095
hi User501.

yes u can have multiple instances of the same form using
the above code as givn by Shauli...

but when u say with different varaibles..what exactly u mean..

if u mean that the variables should store separate values for all instances.. then yes they will..

and if u mean u want to run different code depending on the instance or value passed while opening a form...then for that u can take a variable say OpenArgs.. depending on the value of this variable u can call ur code..

like
frm.OpenArgs = "1"
frm.show
in the form load of form1 wriet the following code

Select case OpenArgs
 case "1": 'do something
 Case "2"" Do Something
and so on..
end select
0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 12041454
u cannot have multiple instances of a mdi form .. but u can have multilpe instances of a normal form using the example that shauli menions above
0
 
LVL 3

Assisted Solution

by:redfordb
redfordb earned 25 total points
ID: 12041707
Remember that once you are finished with the form you need to free the memory that it was using.
ie Set myform = nothing.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Can we place a tooltip on the actual vb6 form 5 57
Send outlook email from VBS Script 2 67
Problem to line 23 80
Create a list of Worksheets based on Cell Value 14 29
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

738 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