Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Close User Form Gazz_85[_2_] Excel Discussion (Misc queries) 1 July 8th 09 10:38 AM
Close user form when button is pressed april27 Excel Programming 1 June 16th 06 11:03 AM
Open Only the User Form ... or Close Everything ! monir Excel Programming 4 April 2nd 06 09:30 PM
How to: User Form to assign a user defined range to a macro variab TrevTrav Excel Programming 1 March 22nd 05 07:57 PM


All times are GMT +1. The time now is 02:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"