|
-
Mar 12th, 2001, 12:58 AM
#1
Thread Starter
Addicted Member
Dear Friends,
I have a child form call frmDocument
I instantiate a form from it using
Dim frmD as frmDocument
Set frmD = New frmDocument
frmD.Caption = "Workspace" & counter
frmD.thisVariable = MyParameter
frmD.show
But how come thisVariable is nothing when I debug.print it out in the Form_Load event of frmDocument.
How can I solve it?
Thanks
-
Mar 12th, 2001, 01:18 AM
#2
PowerPoster
There are a few ways: Declare a Global variable in a standard module (.bas). Declare a private variable in the form module where the variable you want to pass resides in. Or you can just pass it as an argument to a procedure or function in the destination form. You could also use a property Let statement.
Last edited by Lethal; Mar 12th, 2001 at 01:21 AM.
-
Mar 12th, 2001, 01:26 AM
#3
Well ...
Originally posted by cantene
Dear Friends,
I have a child form call frmDocument
I instantiate a form from it using
Dim frmD as frmDocument
Set frmD = New frmDocument
frmD.Caption = "Workspace" & counter
frmD.thisVariable = MyParameter
frmD.show
But how come thisVariable is nothing when I debug.print it out in the Form_Load event of frmDocument.
How can I solve it?
Thanks
Don't know for sure, but try putting this debug.print in the Form_Activate event and see if it gives you the correct results.
.
-
Mar 12th, 2001, 01:38 AM
#4
Thread Starter
Addicted Member
Dear Lethal
Can the Let Property be called by other places outside the form module?
Thanks
-
Mar 12th, 2001, 01:47 AM
#5
PowerPoster
Sure...Just declare the Let Procedure as Public.
-
Mar 12th, 2001, 02:31 AM
#6
Thread Starter
Addicted Member
Hey, I know what's happen
When I set frmD.Caption
the form form event is immediately triggerred so that the subsequent code face error due to not ready preparation of the database connection string.
Now I just solve it by setting a public variable in a BAS module to allow the Form Load event to read it
Very low-level solving dirty skill
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
|