I have 2 userforms name "Home" and "Permanent".
Home has several command buttons on it and one of them is set to close home and open permanent as follows.
The "Permanent" userform has several controls on it that are editable by the user however, I do not want to put a close button on the userform. The user will have to use the "X" to close the form. I have a userform terminate procedure to run when the user clicks the "X" close button to reopen the Home userform as follows.
At this point - the user once again has the option to click the command button that opens "Permanent" - this is fine however, if the user does indeed open "Permanent" a second time, the "X" close button on the "Permanent" userform no longer works. I assumed this is because at no point was the "Permanent" userform actually unloading so I adjusted the terminate procedure to the following.
Even with this modification, if the "Permanent" userform gets opened a second time.... the "X" close button no longer works.
In the end - what I am looking for is a way to do this sequence without somehow disabling the "X" button as I seem to be doing. The "X" button is the only way for the user to exit out of the "Permanent" userform so it needs to work.
Thanks in advance for taking the time to help.
Cheers!
Home has several command buttons on it and one of them is set to close home and open permanent as follows.
Code:
Unload Home
Permanent.Show
The "Permanent" userform has several controls on it that are editable by the user however, I do not want to put a close button on the userform. The user will have to use the "X" to close the form. I have a userform terminate procedure to run when the user clicks the "X" close button to reopen the Home userform as follows.
Code:
Private Sub UserForm_Terminate()
HOME.Show
End Sub
At this point - the user once again has the option to click the command button that opens "Permanent" - this is fine however, if the user does indeed open "Permanent" a second time, the "X" close button on the "Permanent" userform no longer works. I assumed this is because at no point was the "Permanent" userform actually unloading so I adjusted the terminate procedure to the following.
Code:
Private Sub UserForm_Terminate()
Unload Permanent
HOME.Show
End Sub
Even with this modification, if the "Permanent" userform gets opened a second time.... the "X" close button no longer works.
In the end - what I am looking for is a way to do this sequence without somehow disabling the "X" button as I seem to be doing. The "X" button is the only way for the user to exit out of the "Permanent" userform so it needs to work.
Thanks in advance for taking the time to help.
Cheers!