You could use form's owner property.
Calling Form99 would be
Form1
Form99.Show(Me) ' Me i.e. owner is now Form1
Form2
Form99.Show(Me) ' Me i.e. owner is now Form2
To find out who's the caller (i.e. owner), read the owner property:
Private Sub Form99_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Set form's caption to show the owner
' Here the 'Me' refers to Form99
Me.Text = Me.Owner.Text & " is the owner (caller) of the Form99"
End Sub
HTH
Teme64
Veteran Poster
1,040 posts since Aug 2008
Reputation Points: 218
Solved Threads: 206
Skill Endorsements: 5
See if this helps.
Form99:
Public Class Form99
Public selForm As Form = Nothing
Private Sub frm99_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.TextBox1.Text = CType(selForm.Controls("TextBox1"), TextBox).Text
Me.TextBox2.Text = CType(selForm.Controls("TextBox2"), TextBox).Text
End Sub
End Class
All other Forms:
With Form99
.selForm = Me
.Show()
End With
codeorder
Postaholic
2,124 posts since Aug 2010
Reputation Points: 256
Solved Threads: 387
Skill Endorsements: 8
Question Answered as of 1 Year Ago by
Teme64
and
codeorder