|
-
Dec 14th, 2010, 12:01 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Excel Form
Hi need your help guys,
i got two forms on excel, userform1 and userform2.
When i click on userform1 button to display userform2, it works okay but when i close userform2 and click the button again to display userform2. The form will display but it will hang.
The form cannot be closed need to press cntrl break to exit.
any ideas is greatly appreciated..
The taller the bamboo grows the lower it bends... 
-
Dec 14th, 2010, 03:04 AM
#2
Re: Excel Form
if you show us some code, maybe we can figure what is happening
the procedure that opens form2 and the code within form 2, that may be relevant
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Dec 14th, 2010, 05:14 AM
#3
Thread Starter
Addicted Member
Re: Excel Form
Hi westconn, it's just a simple hide and show. i don't know why it's messing up.
Code:
userform1 button:
userform2.show
unload me
Code:
userform2_terminate event:
userform1.show
unload me
The taller the bamboo grows the lower it bends... 
-
Dec 14th, 2010, 05:55 AM
#4
Re: Excel Form
probably should not have unload me in the terminate event as well as it is already unloading
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Dec 14th, 2010, 08:56 PM
#5
Thread Starter
Addicted Member
Re: Excel Form
hi westconn1, had tried taking out the unload me on the terminate event but makes no difference. the form still hang. any ideas?
thanks.
The taller the bamboo grows the lower it bends... 
-
Dec 15th, 2010, 03:04 AM
#6
Re: Excel Form
does form1 unload after form2 unloads?
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Dec 16th, 2010, 12:17 AM
#7
Thread Starter
Addicted Member
Re: Excel Form
 Originally Posted by westconn1
does form1 unload after form2 unloads?
first click on button of form1 to display form2. form1 will hide and form2 will display.
then close form2. form1 will display.
click again on button on form1 to display form2. form1 will hide and form2 will display.
tried closing form2, but will not close. Form2 hang.
this was the sequence of the problem.
But i was able to notice that when i place a code on form2 terminate event or either form2 activate the thing will hang.
so what i did i just make a code to disable the x button on the form and force the user to use the exit button on the form. problem solved.
but why is it, when placing a code on terminate or activate event will cause the hang?
thanks for your reply westconn
The taller the bamboo grows the lower it bends... 
-
Dec 16th, 2010, 03:56 AM
#8
Re: Excel Form
as your code in the button was
show form2 then unload me
form1 should have unloaded when form2 was closed
why it didn't is a mystery to me
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|