Solved

Show form most than one time

Posted on 2004-08-04
5
241 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 51

Expert Comment

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

?
0
 
LVL 51

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

685 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