Thread: close user form
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
ViestaWu ViestaWu is offline
external usenet poster
 
Posts: 48
Default close user form

Thanks Duncan and Shameem, it really works.



"Duncan" wrote:

Agree with Shameem,

when you show the next form, the code will stop until that form has
gone, so correct is to unload BEFORE showing or else your next line
after show will not activate until the form you have shown has gone.

I would avoid using hide.....unload at all instances where you need to
switch and then you will not get loads of forms hanging in the
background.

Duncan


Shameem wrote:

Try this:

.....
Unload frmLog
frm2.show
Exit sub.....


"ViestaWu" wrote:

Could anyone get rid of my confusion?

I have two user forms. first is for user log in, named frmLog, second is
frm2. I'd like it do like this, if log in succeeds, frmlog close and frm2
shows.

.....
frm2.show
unload frmLog
exit sub
...

but result is frmLog is still shown when frm2 could be seen, and frm is on
the front of frmLog. Why it is like this?

many many tks,
Viesta