Solved

VB: HOW TO LOAD THE SAME FORM TWICE??

Posted on 2004-04-12
8
414 Views
Last Modified: 2006-11-17
Hi all,

I have an application that a "father" and his "son" are using the same form.  The only difference is I used a boolean to identify whether this is "father" or "son".  The question is how can I open / load "father" and "son" simultaneously.

Should I need to write class to do it?? If so, any sample code??

This is quite urgent for me.  Thanks all, man / girls!!! ^_^
0
Comment
Question by:wbmsc
  • 3
  • 3
  • 2
8 Comments
 
LVL 27

Expert Comment

by:Dabas
ID: 10804339
Hi wbmsc:
VB6? VB.NET?
Also not clear what you mean by "father" and "son"

Dabas
0
 

Author Comment

by:wbmsc
ID: 10804366
VB6.  Oh sorry... May be I ask the question in this way.  How can I open the same form twice, let's say "frmCustomer", simultaneously and appear on the screen??

B Rgds,
Kenny

0
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 10804368
You need to define a New Form Object:

Example:

In vb 6:

Dim frm As New Form1
    frm.Show

in vb.net

Dim frm As New Form1()
            frm.Show()
0
 
LVL 49

Accepted Solution

by:
Ryan Chong earned 50 total points
ID: 10804371
so, try this:

Dim frmSon As New frmCustomer
frmSon.Show

Dim frmParent As New frmCustomer
frmParent.Show

cheers :-)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 27

Expert Comment

by:Dabas
ID: 10804377
wbmsc:
I support ryancys second answer

Dabas
0
 

Author Comment

by:wbmsc
ID: 10804396
Thanks ryancys, it exactly what I looking for and I can now open the same form with different parameters into it.

As I seldom to use the form as a new object, so ask a stupid question... Thanks, by the way.

Cheers!! ^_^

Kenny
0
 

Author Comment

by:wbmsc
ID: 10804466
Well, but another question is, if I call frmFather.DisplayResult and frmSon.DisplayResult, all the global variables are not properly recognized.

For instance, I have
Public mstrButtonName as string

Option Explicit
.
.
.

However, when I try to locate frmFather.mstrButtonName, it returns me a null value.  Is there any more stuff that I need to pay attention?
0
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 10806405
>>if I call frmFather.DisplayResult and frmSon.DisplayResult, all the global variables are not properly recognized.
If you mean to use same variable in all of the forms (modules) in your application, you can declare the variable in the Module. Try add in a Module, then declare your variable there:

Public mstrButtonName as string

Glad could make helps ;-) cheers
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
count7 challenge 12 100
base64 decode encode 12 119
Non-recursive backtracking, using a stack 1 96
Base1 Encode/Decode 3 67
A short article about a problem I had getting the GPS LocationListener working.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

930 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now