Hi Shachar
I'm assuming you've added a property called Id to Form2...
The problem could be your declaration (if you have Option Strict On).
You have declared
Dim MyForm2 As Form = New Form2
This means that you have a Form reference, not a Form2 reference - with
Option Strict On, as Form does not have an Id property, you can't access it -
even though the MyForm2 object has an Id property.
Two solutions:
1. Change the declaration to
Dim MyForm2 As Form2 = New Form2
or
Dim MyForm2 As New Form2
(Identical performance)
or turn Option Strict Off...slower, because now reflection will be used to
look up the property and set the value.
HTH
Nigel
"shachar" wrote:
hi all.
in form1 i wrote:
dim MyForm2 as form=new form2
now i want to insert data to the property "id" of form2.
i wrote:
MyForm2.Id=3
but i get an error saying "Id" is not a member of
system...
how can i address the property of form2, contained by
form1?