VB6 Multi form problem

Started by
2 comments, last by Marz 19 years, 1 month ago
I am using Visual Basic 6 to create a character generator for an RPG. The characters are generated on the first forum. Once the person selects the stats he likes he presses continue which loads forum2. The continue button holds the code that transfers the stats from form 1 to form 2. My problem is that I want to display a variables value in a text box on form 2 but when the button is pressed it will not load. It is strange as the stats load fine using form2.txtstrength2 = strength.
Advertisement
Quote:Original post by Marz
I am using Visual Basic 6 to create a character generator for an RPG. The characters are generated on the first forum. Once the person selects the stats he likes he presses continue which loads forum2. The continue button holds the code that transfers the stats from form 1 to form 2.

My problem is that I want to display a variables value in a text box on form 2 but when the button is pressed it will not load. It is strange as the stats load fine using form2.txtstrength2 = strength.


Try this, it should work.

form2.txtstrength.text = strength


Notice you'd missed out the .text

Or have I misunderstood you, and the other form won't load at all? Or is it just the value doesn't appear in the textbox? I'm confused, but hope what I put up there helps you in some way or another.
Sorry my bad. I have the strength and other stats working using

form2.txtstrength.text = strength.

The variable that won't load is called Aad I have it declared as dim Aad as Integer, initialized Aad = 4 but when I try and store it in a text box named abilityadjust as so form2.abilityadjust.text = Aad it does not appear. Form2 loads fine and displays all the stats


What if I made an invisible command button on form2 to put the ability adjust code under and then put code under the continue button on form1 that clicks the invisible command button?

There is no click command but I think it would be Form2.inviscommand.Value = True

Is this correct?

I'm not sude how to do this but
I got it.
Thanks, I appreciate the help.

This topic is closed to new replies.

Advertisement