Improve company productivity with a Business Account.Sign Up


Close 2 Forms on Exit

Posted on 2006-10-30
Medium Priority
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.

Question by:stephenz43
  • 2
  • 2
  • 2
  • +1
LVL 12

Expert Comment

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

Author Comment

ID: 17832248
formA is not a startup form nor a parent
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

LVL 143

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.
LVL 12

Accepted Solution

Praveen Kumar earned 2000 total points
ID: 17832264
try this..

Dim f As New formReference

Sub Button_Click(.................)
End Sub

End Sub
LVL 10

Expert Comment

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

Expert Comment

ID: 17843207

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Article by: Jorge
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String ( Literal, only instead of starting and ending with w…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Free Data Recovery software is an advanced solution from Kernel Tools to recover data and files such as documents, emails, database, media and pictures, etc. It supports recovery from physical & logical drive after a hard disk crash, accidental/inte…
Through the video, you can check the migration process of Outlook PST file to PDF. Kernel for Outlook to PDF tool can convert Outlook emails with all attributes like Subject, To, From, Cc, Bcc and other folders such as Inbox, Outbox, Sent Items, Jun…

595 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