Dear Supra and John
I know what you mean, and i have to declare a variable of form1 type.
But this would be appropriate if i am calling a new instance of form1. which
is not the case.
as fom1 is the caller for form2 and i need to modify a control on the
existing form1.
* when i added
form1.textbox1.text = "test"
the error "Reference to a non-shared member requires an object reference."
was generated.
* When I added
Dim frn As Form1
frn.textbox1.text = "test"
the runtime error "Object reference not set to an instance of an object."
was generated
* As for using
Dim frn As new Form1
frn.textbox1.text = "test"
nothing happens and when i show frm the control property is modified
nnormally, but again i want to modiy a property in the calling form not in a
freshly called instance.
thanks again and hope somebody can help.
Regards
Sameh
jcrouse said:
Yes...it's kind of like a file path. Just precede the controlname
(button1) with the form name(form1). Such as: "form1.button1.text = "OK""
You will also need to declare form1 on form2 if you reference it. Put a
statement such as: "Dim frm1 as New Form1" on form2.