Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Userforms Won't Close

I have coding for an application that uses three userforms, a Main form, a
Team form, and a form for changes to team information. I have coded for
moving from form-to-form and back. Data moves correctly back and forth. I
have checked to make sure the forms are unloaded when another form is loaded.
There are no loops in the coding. However, when I click on a "browse"
command button on the Main form that closes the userform and goes to the
worksheet, one form stays open.

Without boring you all with extensive coding, is there something I'm missing
about closing a form with "frm_Main.hide"? I tried coding for closing ALL
forms but the same thing happens. Any help would be appreciated as I've been
all through this, forwards and backwards, and can't see the problem.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Userforms Won't Close

There is nothing wrong with that syntax. There could be other things wrong
but it is hard to tell from the info provided.

"dunnerca" wrote:

I have coding for an application that uses three userforms, a Main form, a
Team form, and a form for changes to team information. I have coded for
moving from form-to-form and back. Data moves correctly back and forth. I
have checked to make sure the forms are unloaded when another form is loaded.
There are no loops in the coding. However, when I click on a "browse"
command button on the Main form that closes the userform and goes to the
worksheet, one form stays open.

Without boring you all with extensive coding, is there something I'm missing
about closing a form with "frm_Main.hide"? I tried coding for closing ALL
forms but the same thing happens. Any help would be appreciated as I've been
all through this, forwards and backwards, and can't see the problem.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Userforms Won't Close

I have checked to make sure the forms are
unloaded when another form is loaded.


How have you concluded that.
If your forms are model, although you can Hide a form as you load and.or
show the next form, they will all remain loaded until you unload the last
Form. Code will revert to the form that opened a form at which point you can
then unload it, all the way back to your first form.

Regards,
Peter T


"dunnerca" wrote in message
...
I have coding for an application that uses three userforms, a Main form, a
Team form, and a form for changes to team information. I have coded for
moving from form-to-form and back. Data moves correctly back and forth.

I
have checked to make sure the forms are unloaded when another form is

loaded.
There are no loops in the coding. However, when I click on a "browse"
command button on the Main form that closes the userform and goes to the
worksheet, one form stays open.

Without boring you all with extensive coding, is there something I'm

missing
about closing a form with "frm_Main.hide"? I tried coding for closing ALL
forms but the same thing happens. Any help would be appreciated as I've

been
all through this, forwards and backwards, and can't see the problem.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Userforms Won't Close

Thanks, Peter. The modal/non-modal issue cured the problem. I changed all
my "frm_name.hide" commands to "unload frm_name" and used the false argument
for the form.show command and it works fine. Many thanks for your knowledge.

Kevin

"Peter T" wrote:

I have checked to make sure the forms are
unloaded when another form is loaded.


How have you concluded that.
If your forms are model, although you can Hide a form as you load and.or
show the next form, they will all remain loaded until you unload the last
Form. Code will revert to the form that opened a form at which point you can
then unload it, all the way back to your first form.

Regards,
Peter T


"dunnerca" wrote in message
...
I have coding for an application that uses three userforms, a Main form, a
Team form, and a form for changes to team information. I have coded for
moving from form-to-form and back. Data moves correctly back and forth.

I
have checked to make sure the forms are unloaded when another form is

loaded.
There are no loops in the coding. However, when I click on a "browse"
command button on the Main form that closes the userform and goes to the
worksheet, one form stays open.

Without boring you all with extensive coding, is there something I'm

missing
about closing a form with "frm_Main.hide"? I tried coding for closing ALL
forms but the same thing happens. Any help would be appreciated as I've

been
all through this, forwards and backwards, and can't see the problem.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Userforms Won't Close

I found this online and it is also useful in closeing out all open forms...

Procedure CloseForms

local lnForms, llDone

lnForms = _SCREEN.FormCount

llDone = .T.

DO WHILE lnForms 0 AND llDone

if pemstatus(_SCREEN.Forms(lnForms),'QueryUnload' ,5)

llDone = _SCREEN.Forms(lnForms).QueryUnload()

endif

IF llDone

_SCREEN.Forms(lnForms).Release

lnForms = _SCREEN.FormCount

ENDIF

ENDDO

RETURN

Hope all helps...

J.

"dunnerca" wrote:

Thanks, Peter. The modal/non-modal issue cured the problem. I changed all
my "frm_name.hide" commands to "unload frm_name" and used the false argument
for the form.show command and it works fine. Many thanks for your knowledge.

Kevin

"Peter T" wrote:

I have checked to make sure the forms are
unloaded when another form is loaded.


How have you concluded that.
If your forms are model, although you can Hide a form as you load and.or
show the next form, they will all remain loaded until you unload the last
Form. Code will revert to the form that opened a form at which point you can
then unload it, all the way back to your first form.

Regards,
Peter T


"dunnerca" wrote in message
...
I have coding for an application that uses three userforms, a Main form, a
Team form, and a form for changes to team information. I have coded for
moving from form-to-form and back. Data moves correctly back and forth.

I
have checked to make sure the forms are unloaded when another form is

loaded.
There are no loops in the coding. However, when I click on a "browse"
command button on the Main form that closes the userform and goes to the
worksheet, one form stays open.

Without boring you all with extensive coding, is there something I'm

missing
about closing a form with "frm_Main.hide"? I tried coding for closing ALL
forms but the same thing happens. Any help would be appreciated as I've

been
all through this, forwards and backwards, and can't see the problem.




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
Can I stop the close method in an auto close macro Paul Excel Programming 2 November 17th 06 02:48 PM
Don't let user close. Use macro button to close? mike Excel Programming 2 October 30th 06 01:31 PM
In Before Close Sub ActiveWorkBook.Close(False) repeat procedure [email protected] Excel Programming 5 September 26th 06 03:11 PM
Excel shoud not close all active books when clicking close button technomike Excel Discussion (Misc queries) 0 June 10th 05 05:35 PM
excel - Windows close button (x) should only close active workboo. CoffeeAdict Setting up and Configuration of Excel 3 February 8th 05 04:30 AM


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

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"