p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).

Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 2nd, 2003, 08:27 AM
Friend of Wrox
Points: 513, Level: 8
Points: 513, Level: 8 Points: 513, Level: 8 Points: 513, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2003
Location: , Kent, United Kingdom.
Posts: 130
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing Values from a Form to another

Help!!!!!!!!!!!

I have two forms, I am passing a value from an on click sub procedure that creates and shows a form to the form that is called but I am unsuccessful.

Do I have to create the form in the on click procedure using the new form and pass it to a procedure within that new form or can I pass it another way?

(Using VB6)

Thanks in advance

Louisa

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old September 2nd, 2003, 08:56 AM
Authorized User
Points: 256, Level: 5
Points: 256, Level: 5 Points: 256, Level: 5 Points: 256, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , FL, USA.
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You question is a bit vague but I believe your problem could be solved with the use of a global variable. The way I do this is to create a seperate module for my globals and assign their values when I need them .. like this.

----------------------------------------------------------------
basGlobals

Public gmyGlobal as DataType (whatever it needs to be string, integer, ect)
----------------------------------------------------------------

Private Sub Command1_Click()

   gmyGlobal = Value
   Form2.show

End Sub
----------------------------------------------------------

If you do it this way the value will be retained even if you unload the initial form. You do have to keep in mind that the global variable will hold the value you assign it until you either reassign it or end the program. My point there is you always need to be aware of it's value when using it in multiple places throughout your application or you may get some unexpected results.

Hope this helps.



Kenny Alligood
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing Form Values in ASP.Net sankar General .NET 10 September 21st, 2006 12:13 PM
passing values Ramakrishna ASP.NET 1.1 2 September 7th, 2004 08:13 AM
Passing form values from 1 frame to another. edkeyte Javascript How-To 4 February 2nd, 2004 12:33 PM
Passing values to a form mschenk Access VBA 4 November 30th, 2003 11:39 PM
passing Multidimensional Array Values back to form stitch Classic ASP Databases 1 September 4th, 2003 04:33 PM



All times are GMT -4. The time now is 06:49 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc