ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Close User Form (https://www.excelbanter.com/excel-discussion-misc-queries/236191-close-user-form.html)

Gazz_85[_2_]

Close User Form
 
I have a form that is used to filter information, within that form there are
sub forms of information. how do i set it up so that once you click an option
on a sub form it automatically closes and returns to original form??

Jacob Skaria

Close User Form
 
Use the below code from the subform

Unload Me


'Example ------------------------
'Load userform2 from userform1 (on command button click)
Private Sub CommandButton1_Click()
Load UserForm2
UserForm2.Show
End Sub

'Unload userform2 and get back to userform1
Private Sub CommandButton1_Click()
Unload Me
End Sub

In sub form call

Unload Me
--
If this post helps click Yes
---------------
Jacob Skaria


"Gazz_85" wrote:

I have a form that is used to filter information, within that form there are
sub forms of information. how do i set it up so that once you click an option
on a sub form it automatically closes and returns to original form??



All times are GMT +1. The time now is 09:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com