Solved

Close 2 Forms on Exit

Posted on 2006-10-30
7
187 Views
Last Modified: 2008-03-10
Hey guys

Ive got a formA that has a button that fires another form (reference Card) . I want to close both formA and formReference when formA is exited. Cant seem to get it right.

Thanks
0
Comment
Question by:stephenz43
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 12

Expert Comment

by:Mamtha1982
ID: 17832212
If FormA if startup form, then you can write Me.Close() or End in FormA to close all forms.
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17832221
0
 

Author Comment

by:stephenz43
ID: 17832248
formA is not a startup form nor a parent
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 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17832259
>Ive got a formA that has a button that fires another form
that means that formA is the "parent" of the other one...
I guess a confusion of terms here.

As formA fires the other form, it should have/retain that form's reference. and using that, it can close it also at any time.
0
 
LVL 12

Accepted Solution

by:
Mamtha1982 earned 500 total points
ID: 17832264
try this..

Dim f As New formReference

Sub Button_Click(.................)
f.Show()
End Sub

Form1_FormClosing(.................)
     f.Close()
End Sub
0
 
LVL 10

Expert Comment

by:Kinger247
ID: 17843205
Bit late but you can lop through the My.Application.OpenForms and close them fromt he main form.
0
 
LVL 10

Expert Comment

by:Kinger247
ID: 17843207
"Loop"
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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

920 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

15 Experts available now in Live!

Get 1:1 Help Now