Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 30th, 2005, 07:30 AM
Raidea Raidea is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 3 Raidea User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 51 sec
Reputation Power: 0
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?

Reply With Quote
  #2  
Old March 30th, 2005, 10:23 AM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,770 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 7 h 8 m 6 sec
Reputation Power: 469
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.

Reply With Quote
  #3  
Old March 30th, 2005, 04:03 PM
Raidea Raidea is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 3 Raidea User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 51 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Importing values across forms


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT