close user form

V

ViestaWu

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
 
B

Bob Phillips

Call the login form from your main for, in the activate event. When you
close it, it then returns to main.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
D

Duncan

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
 
V

ViestaWu

Thanks Duncan and Shameem, it really works.



Duncan said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top