title: VB.NET Call Sub of another form
body: <p>I know, that there are many questions related to this, but still I cannot find a workable solution.</p>
  
  <p>Usually, it would work like this: A form creates an instance of another form in it's container like this:</p>
  
  <pre><code>Dim PolInstIn As New SubForm1
  
  Private Sub LoadDetail()
  
      PolInstIn.TopLevel = False
      PolInstIn.Name = "Sub From" 
      PolInstIn.FormBorderStyle = Windows.Forms.FormBorderStyle.None
      PolInstIn.Dock = DockStyle.Fill
  
      Me.GroupBox6.Controls.Add(PolInstIn)
      PolInstIn.Show()
  
  End Sub
  </code></pre>
  
  <p>Then it's easy to call a Public Sub from the sub form like this:</p>
  
  <pre><code>    Call PolInstIn.MyPublicSubInSubForm1()
  </code></pre>
  
  <p>However, this doesn't work for me in this case. When I run MyPublicSubInSubForm1() it doesn't throw any error, but does no action. If I write a value to SubForm1 textbox and read it back, it reads, but I don't see it on the screen, so I suspect it is written to some other <em>accidental</em> instance.</p>
  
  <p>I suspect it is because my parent form is also an <em>instance</em> of an form created in very similar way like SubForm1. Basically the ParentForm is a form loaded into tabPage and SubForm1 is a module loaded into ParentForm. It can exist in many copies (tabs).</p>
  
  <p>Could you point to any simple solutions?</p>
  
  <p>Regards,</p>
  
  <p>Libor</p>