|
-
Nov 5th, 2000, 12:02 PM
#1
How can i pass variables from one form to another??
-
Nov 5th, 2000, 02:14 PM
#2
Hyperactive Member
If you only need to pass the variables into one function in a form you can set up that function to accept variables
Public Sub Edit(var1 as long, var2 as variant)
'
End Sub
If you need to change the values of these variables within this function you shoul pass them 'ByRef'. If however you will need to acces them throughout both forms then you are better off adding a module to your project and setting up the variables in the module as Global.
-
Nov 5th, 2000, 08:09 PM
#3
MAKAI post in another forum
perhaps you want to declare a variable as Public in a code module
Project->Add Module
'example - only one line needed in the module
Public myVar as Integer
then you can use myVar in all forms in a project
-
Nov 6th, 2000, 09:54 AM
#4
Lively Member
Could always use PUBLIC PROPERTY GETs & LETs. At least it'll keep consistency with any classes that way.
Anakim
It's a small world but I wouldn't like to paint it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|