|
-
December 26th, 1999, 04:55 PM
#1
Public Variables
I am cerating a PUBLIC variable as follows:
public abc as string
I populate that variable in Form1 and try to access it in a Form2 procedure, but it does not appear to contain any data in Form2....
-
December 27th, 1999, 02:01 AM
#2
Re: Public Variables
It is preferrable to define all the public variables, subroutines and functions in the Module level, but it
doesn't mean that you did something wrong. Check all the subs/functions of Form1 and Form2.
Maybe, somewhere, by mistake, you define the same variable as Private. That's why your public
variable didn't receive the desired value. The another reason could be that you loading Form2 before
giving any value to this variable. If you check everything and still have the same problem, you may
e-mail me your project and I'll try to help you.
Good Luck!
-
December 27th, 1999, 03:39 AM
#3
Re: Public Variables
May be because you do not refering the form.
You have declared abc in form1 as public.
To refer it in form2
use
form1.abc = something
Santulan
-
December 27th, 1999, 07:20 AM
#4
Re: Public Variables
In Form2 I am referring to it as frmForm1.text=abc
-
December 27th, 1999, 01:04 PM
#5
Re: Public Variables
Then you could try Form1.Text=Form1.Abc from Form2 if both Text and Abc are public (BTW, it's highly recommended not to use reserved words as user defined variables - I mean Text). If I understood you right it must help if not. . . I tried. Good luck.
Jean Spector
Tech Support Team Leader, CET
[email protected]
(in VB from 11/1999)
-
December 28th, 1999, 01:24 AM
#6
Re: Public Variables
hi
see pal!! u gotta add a module to ur existing project ,right click on the project explorer where form is there then u will find a option add,go and add the option MODULE not anyother.. then declare that varibale in that module
it will be globally accepted wherever u populate 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
|