Thread: Form not hiding
View Single Post
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

Shouldn't B be:

Sub B()
form1.Hide
form2.Show
DoEvents
End Sub

Try changing the doEvents to:
msgbox "hi"

And you'll see when it gets executed (in the original sub).


LB79 wrote:

Hello - Hope someone can help - this is driving me mad.
Ive looked at the other threads relating to this but the advice hasnt
seemed to work for me.
I have a userform that has a button. When the button is pushed the
first userform should close and and a second should open. This works
except the first userform stays visible in the background.
Ive tried using DoEvents and unloading but this hasnt worked for me.
Ive tried the following codes:

Sub B()
form2.Show
form1.Hide
DoEvents
End Sub

Sub A()
form1.Hide
form2.Show
DoEvents
End Sub

Thanks

--
LB79
------------------------------------------------------------------------
LB79's Profile: http://www.excelforum.com/member.php...o&userid=12156
View this thread: http://www.excelforum.com/showthread...hreadid=396483


--

Dave Peterson