View Full Version : Some problems by using two userforms

01-10-2016, 04:05 AM
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!

01-10-2016, 04:16 AM
Kennst du http://www.office-loesung.de/p/viewforum.php?f=166 ?

01-10-2016, 04:32 AM
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!

01-10-2016, 05:14 AM
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.

01-10-2016, 05:21 AM
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!

01-10-2016, 10:38 AM
Thank You so much for your help!

Now everything is working fine!

Thank You so so much!

01-10-2016, 10:49 AM
De nada.