Solved

Show form most than one time

Posted on 2004-08-04
5
238 Views
Last Modified: 2010-05-02
How can I show a Form for more than one time??

Form1.show

I want to show the same form for more time..


THanks!
0
Comment
Question by:leekf
5 Comments
 
LVL 5

Expert Comment

by:ZenMasterrr
ID: 11713547
not sure what you mean, do you mean you want to duplicate ?
0
 
LVL 50

Expert Comment

by:Ryan Chong
ID: 11713564
...
Dim frm As New Form1
frm.show
...

?
0
 
LVL 50

Expert Comment

by:Ryan Chong
ID: 11713568
or

...
Dim frm As Form1
Set frm = New Form1
frm.show
...
0
 
LVL 3

Accepted Solution

by:
TILL earned 50 total points
ID: 11713764
If you wish to show a form more than once, this meaning that you want to have multiple form instances active, you have to create and show multiple instances. You can do this by performing the following:

Dim frm1 as MyForm
Dim frm2 as MyForm
Set frm1=new MyForm
Set frm2=new MyForm
Load frm1
Load frm2
frm1.Show
frm2.Show
...
' Do something here
...
unload frm1
unload frm2
Set frm1=nothing
Set frm2=nothing


The code from above displays 2 forms for a while (while that something is performing) and after that it closes both form instances and releases all the resources.
If you need more directions, please feel free to ask.

Regards,
TILL
0
 
LVL 18

Expert Comment

by:JR2003
ID: 11713846
Private Sub Command1_Click()

    ShowMyForm
    ShowMyForm

End Sub

Private Sub ShowMyForm()

    Dim f as frmMyForm
    Set f = New frmMyForm
    f.Show

End Sub
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

832 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