|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Importing values across forms
Ok, I'm using VB 6.0
Basically, my problem is I have various values in one form which a user enters into text boxes (txbWind, txbVelo etc.) and I need to use these values in another form for various calculations. How do I take them from one form to use in another? |
|
#2
|
||||
|
||||
|
You could add a module to your application and declare your global variables there.
Then on the first form, just set the global variables to the values of form fields, then the second form would just check the global variables. Example: Code:
Global Module Module1 Public strName As String Public strAddress As String Public strCity As String End Module On the 1st form, set the global variables to the form fields values. strName = txtName.Text strAddress = txtAddress.Text strCity = txtAddress.Text On the 2nd form, just read the global variables txtName.Text = strName txtAddress.Text = strAddress txtCity.Text = strCity Using a module makes all of the code and variables within it accessible to every form in the application. |
|
#3
|
|||
|
|||
|
Great, thanks very much.
That will probarbly make a nice additional part to my project too, even though it's not very complex. Any other methods are welcome. |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Importing values across forms |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|