Originally posted by Andy
that should work. post the exact code you're using please.
On form1:

VB Code:
  1. Public frm5 As Form5
  2.  
  3.   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  4.         Dim form5 As New Form5
  5.  
  6.         form5.Show()
  7.  
  8.     End Sub


Form 5 loads, with a textbox, I want to change the text in the box using a button on form1.

VB Code:
  1. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  2.  
  3.                 frm5.TextBox1.Text = "hello"
  4. End Sub



I get this error message:

Object reference not set to an instance of an object.