Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 multiple forms & variables
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
iluvchairs112




PostPosted: Thu Feb 28, 2008 4:34 pm   Post subject: multiple forms & variables

I am using Visual Basic Express 2005 (if this helps)
I've created a form with a variable, let's call this variable decPrice, which the user inputs.
On the second form in this project, I'd like the variable decPrice to be shown
However when I've tried this, the problem is that the variable decPrice is "undeclared" on the second form. How do I get it to acknowledge the decPrice from form 1?
Or is there any way that I can basically take user inputted data from one form and output it on the second form in the same project??

Thanks in advance! I really need help ASAP!
Sponsor
Sponsor
Sponsor
sponsor
OneOffDriveByPoster




PostPosted: Thu Feb 28, 2008 5:11 pm   Post subject: Re: multiple forms & variables

iluvchairs112 @ Thu Feb 28, 2008 4:34 pm wrote:
I am using Visual Basic Express 2005 (if this helps)
I've created a form with a variable, let's call this variable decPrice, which the user inputs.
On the second form in this project, I'd like the variable decPrice to be shown
However when I've tried this, the problem is that the variable decPrice is "undeclared" on the second form. How do I get it to acknowledge the decPrice from form 1?
Or is there any way that I can basically take user inputted data from one form and output it on the second form in the same project??

Thanks in advance! I really need help ASAP!
Try refering to the other form by its name. Form1.decPrice for example.
iluvchairs112




PostPosted: Fri Feb 29, 2008 8:21 am   Post subject: RE:multiple forms & variables

@ OneOffDriveByPoster - thank you so much!!
I can't believe I didn't think of that myself so thanks a ton!
Igneous




PostPosted: Fri Mar 28, 2008 9:10 am   Post subject: Re: multiple forms & variables

hmm i had trouble with this as well and when i tried your method i get an error stating "it is not accesible in this mannor because it is set to private", so as a solution i declared the variable as public and i got another error message. so for the sake of simplicity what am i doing wrong?
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: