Applicable for VB.Net, Not applicable For Classic VB...
Public Class Form2
Public FirstName As String
Private Sub Command1_Click() Handles Command1.Click
Dim LastName As String
Dim Both As String
LastName = txtLastName.Text
both = (FirstName & LastName)
MsgBox (Both)
End Sub
End Class
In Form1 Write code as Follows
Public Class Form1
Private Sub Command1_Click() Handles Command1.Click
Form2.FirstName = txtFirstName.Text
Form2.Show()
Me.Close
End Sub
End Class