stapuff
03-07-2008, 07:02 AM
I have searched for hours looking for a way to close all Userforms on commandbutton click (Regardless of weather they are the active userform (on top) or deactivated userform (on bottom). I have all of my userforms ShowModal = False
Private Sub CmdBtn1_Click()
Call All_UF_Close
UF_DashBrd.Show
UF_CreateWO.Show
End Sub
I have tried everything I can think of to achieve the following, however, it does not close the deactivatated UF located on the bottom.
Public Sub All_UF_Close()
UF_CreateWO.Hide
Unload UF_CreateWO
DoEvents
UF_UpdateWO.Hide
Unload UF_UpdateWO
DoEvents
UF_CancelWO.Hide
Unload UF_CancelWO
DoEvents
UF_CloseWO.Hide
Unload UF_CloseWO
DoEvents
End Sub
Private Sub CmdBtn1_Click()
Call All_UF_Close
UF_DashBrd.Show
UF_CreateWO.Show
End Sub
I have tried everything I can think of to achieve the following, however, it does not close the deactivatated UF located on the bottom.
Public Sub All_UF_Close()
UF_CreateWO.Hide
Unload UF_CreateWO
DoEvents
UF_UpdateWO.Hide
Unload UF_UpdateWO
DoEvents
UF_CancelWO.Hide
Unload UF_CancelWO
DoEvents
UF_CloseWO.Hide
Unload UF_CloseWO
DoEvents
End Sub