Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
close user form
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
close user form
Use frmLog.Hide instead of frmLog.Unload
HTH -- AP "ViestaWu" a écrit dans le message de news: ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
close user form
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) "ViestaWu" wrote in message ... 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
close user form
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
close user form
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 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Close User Form | Excel Discussion (Misc queries) | |||
Close user form when button is pressed | Excel Programming | |||
Open Only the User Form ... or Close Everything ! | Excel Programming | |||
How to: User Form to assign a user defined range to a macro variab | Excel Programming |