Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
Password Reminder
Register
| FAQ | Members List | 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 Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 2nd, 2003, 07:27 AM
Friend of Wrox
 
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

Reply With Quote
  #2 (permalink)  
Old September 2nd, 2003, 07:56 AM
Authorized User
 
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
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
passing Multidimensional Array Values back to form stitch Classic ASP Databases 2 June 21st, 2013 01:59 PM
Passing Form Values in ASP.Net sankar General .NET 10 September 21st, 2006 11: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



All times are GMT -4. The time now is 05:29 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.