Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I stop the close method in an auto close macro | Excel Programming | |||
Don't let user close. Use macro button to close? | Excel Programming | |||
In Before Close Sub ActiveWorkBook.Close(False) repeat procedure | Excel Programming | |||
Excel shoud not close all active books when clicking close button | Excel Discussion (Misc queries) | |||
excel - Windows close button (x) should only close active workboo. | Setting up and Configuration of Excel |