Close 2 Forms on Exit

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
stephenz43Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Praveen KumarConnect With a Mentor ArchitectCommented:
try this..

Dim f As New formReference

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

Form1_FormClosing(.................)
     f.Close()
End Sub
0
 
Praveen KumarArchitectCommented:
If FormA if startup form, then you can write Me.Close() or End in FormA to close all forms.
0
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

 
stephenz43Author Commented:
formA is not a startup form nor a parent
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>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
 
Kinger247Commented:
Bit late but you can lop through the My.Application.OpenForms and close them fromt he main form.
0
 
Kinger247Commented:
"Loop"
0
All Courses

From novice to tech pro — start learning today.