Consulting

Results 1 to 7 of 7

Thread: Some problems by using two userforms

  1. #1

    Some problems by using two userforms

    Hey Guys,
    I'm Sabrina from Germany. I have some trouble with my programm that I'm developing for my Bachelor-Thesis.
    First I want to say sorry for all the wrong english explanations, I'm not a native speaker,..

    So, here it goes:

    I'm using a userform to collect information. After giving Values to some textboxes and pressing the "Start Calculation"-Button, all the values are checked by the programm. For example, whether the expressions are numeric or not.

    After that, the values are passed to a modul where the calculation is taking place. After the calculation, the outcomings are passed to the userform againg, but in different textboxes.
    Here is no mistake to see, everything is working great.

    Now here comes the problem:

    I added another userform. It should be the "Main-Window". Here the user can choose in which direction he wants the programm to work by giving in some values in textboxes. This Userforms calculates which progress is correct and recommends the corresponding userform.

    The values from this new userform are passed to the second userform's textboxes. No mistake till this step.

    Now, when the "Start Calculation"-Button in the second userform is pressed, the programm is not able to work anymore.

    By debugging the module's text, I found out, that there is a mistake:

    "Object Variable or With block variable not set"

    All values from the textboxes are now set to "0" and I don't now why. If I'm just running the second userform, everything is running fine. Just by using the other Userform too, the programm stops itself.


    But I'm not able to find the reason why. There are no changings in the programm-text.



    I hope that I was able to tell what my problem is about..

    Greetings from Germany!

  2. #2

  3. #3
    ich habe es bei Herber's Excel Forum ausprobiert, da habe ich keine Antwort bekommen. Beim MS-Office-Forum bekomme ich keine Anmeldungs-Email,..also habe ich mein Glück mal hier probiert.
    Aber danke für den Tipp!

  4. #4
    Knowledge Base Approver VBAX Guru
    Joined
    Apr 2012
    Posts
    4,652
    First I wouldn't advise to use 2 userforms.
    You can accomplish the same result using frames or multipages that are being made visible depending on what you choose in the main 'choice'.

    Without seeing what code you already have it's simply impossible to answer your detailed questions.

  5. #5
    Yeah, that could be the answer..multipage was my first attempt, but somehow I switched to different userforms.

    The code has about 20 rows. That is why I did not post it here.

    I'll try this procedure, thank's for the quick answer!

  6. #6
    Thank You so much for your help!

    Now everything is working fine!

    Thank You so so much!

  7. #7
    Knowledge Base Approver VBAX Guru
    Joined
    Apr 2012
    Posts
    4,652
    De nada.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •