|
-
March 27th, 2001, 05:43 AM
#1
Access to Form from Main
Hi
I have written a VB program that starts from Sub Main. Sub Main is in a Module and Also I have a form in my project.
How can I access to my form and it's controls from Sub Main
Thanks
-
March 27th, 2001, 05:46 AM
#2
Re: Access to Form from Main
You can reference a form directly by name i.e. if your form is called "Form1" and has a textbox "txtName" rthen the following is perfectly valid in code:
Debug.print Form1.txtName.Text
Note that your VB form is also a template for the creation of forms of the same type i.e.:
Dim frmThis as Form1
set frmThis = new Form1
Debug.print frmThis.txtName.Text
HTH,
Duncan
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
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
|