|
-
Aug 4th, 2000, 07:20 AM
#1
Thread Starter
New Member
It has been 3 years since I did any VB code and I've forgotten how to pass a variable to a form as it loads. Can anyone help, I know its simple but...
Sean
-
Aug 4th, 2000, 07:47 AM
#2
_______
<?>
In what respect.If you are loading your form for the first tiem, your variables will be empty till you load them. If you are loading a second form and what a variable from form1 for use in form2 load then put it in the form2 activate event.
ex. set both forms with same width
on form 1 you have a public variable intWidth
Public intWidth
intWidth = Form1.width
In form2 activate.
Form2.width = intWidth
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 4th, 2000, 08:23 AM
#3
You can store them in a public variable, or you can write to them directly.
Code:
Form2.Command1.Caption = "Hello"
-
Aug 4th, 2000, 08:39 AM
#4
Thread Starter
New Member
To explain it a bit better:
I have a main form which is using a table in access. The Index on this table is RecID. I need to open a second form and link the two forms by passing RecID variable from form 1 to variable GetRecID in form 2. Thanx for the help!
-
Aug 4th, 2000, 09:00 AM
#5
_______
assuming you know how to get the value of RecID
Form1
Public MyVar
MyVar = RecID
Form2 Activate Event
GetRecId = MyVar
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 4th, 2000, 12:51 PM
#6
Addicted Member
Isn't there a better way?
I normally use public setItem subroutines to protect private data...
But isn't there a way to just parametize the load event or something like that? To set initial states at instantiation time?
Thanks.
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
|