Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing multiple forms

Status
Not open for further replies.

bsmith

MIS
Sep 29, 1999
6
US
I have a couple of forms created with the Forms Wizard (I am new to VB). I have a form that opens from another form. When the user clicks on the exit button on the second form I want the underlying form to close too. is there a simple way to do this?
 
If you are using the macro just issue the command to close that form aswell as the current form in the macro. If using VBA then use either Unload &lt;formname&gt; or &lt;formname&gt;.close. I can't quite remember the proper syntax. The unload method is how it is done in VB.<br>
<br>
James :)
 
If you used the Wizard to create an &quot;Close&quot; button on Form2, you can add this to the button's &quot;OnClick&quot; event: DoCmd.Close acForm, &quot;Form1&quot;<br>
If you didn't create an &quot;Close&quot; button on the form but used the standard Windows one, you can add the code to the OnClose event of Form2.<br>
See Help for &quot;Close Method (Microsoft Access)&quot; to see options for saving changes etc.
 
Yes, I used the Wizard for the Close button so I'll try this out. thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top