Results 1 to 8 of 8

Thread: [RESOLVED] Excel Form

Hybrid View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    233

    Resolved [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...

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Excel Form

    any ideas
    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

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    233

    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...

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    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

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    233

    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...

  6. #6
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    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

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    233

    Resolved Re: Excel Form

    Quote Originally Posted by westconn1 View Post
    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...

  8. #8
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    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
  •  



Click Here to Expand Forum to Full Width