Hi, I'm using VB .net 2003 windows form. I have 2 forms.
Form1 contains: TextBox1, ComboBox1
Form2 contains: CommandButton1
I want to use the text entered in TextBox1 and ComBox1 of Form1 in the Form2_Load of Form2. I have used the following code:
Private
Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Form2Obj As New Form2
Dim
cFName As String
Dim
cDDOB As String
cFName = Form2Obj.TextBox1.Text.ToString
cDDOB = Form2Obj.ComboBox1.Text.ToString
MessageBox.Show(cFName)
End Sub
But this code is not working. It's not printing the cFName. What should be the appropriate code? Do I need to use Module? If so, what will be the code for Module?