PDA

View Full Version : Multiple user form show/Hide problem



lifeson
11-24-2008, 04:44 AM
I have a project which has a number forms but they keep disappearing!!!

They are all set as ShowModal = true

Each form has a button which will open the next form
the routine is from userform1

userform1 has a cmdButton: userform2.show - (userform 1 is not closed or unloaded)

Userform2 has a cmdbutton: userform3.show - (userform2 is not closed or unloaded)

userform3 has a cmdButton: useform4.show - (userform3 is not closed or unloaded)

This is when I start to get a problem;

userform 4 has a cmdbutton to unload userform4 and show userform3

Private Sub cmdClose_Click()
Unload Me
userform3.Show
End Sub

When this runs, all the forms close and no forms are visible

Is this a bug or am I doing something wrong?

Jan Karel Pieterse
11-24-2008, 05:35 AM
If userform3 was already showing, then the Userform3.Show shouldn't be needed, should it?

hiflier
01-07-2009, 01:29 AM
Might try the Unload command after the show command.

Private Sub cmdClose_Click()
userform3.Show
UnLoad UserForm4

End Sub