Hi,
In my project I have form1 and module1
On form1 I have a textbox1

In my module I am trying to open a text file and send it to the textbox on form1. This is my code..

Code:
Imports system.IO

Dim serverconfig As TextReader 

Public Sub openfile() 
        Dim frm1 As New Form1() 
        Dim a As String 
        a = "C:\a.txt" 
        serverconfig = New StreamReader(a) 
        frm1.TextBox1.Text = serverconfig.ReadToEnd 
End Sub
On form1 Load I simply put -- "openfile"

When I do it this way, no text appears in my textbox. But If I put the code from my module directly into my form1_load (replacing frm1.Textbox1.Text with Textbox1.Text) It prints out the Text File fine. I seem to be having problems with the line "frm1.TextBox1.Text = serverconfig.ReadToEnd"...
However in my module if I just type frm1...Then it comes up with all the objects on my Form1 (TextBox1) So I don't know what the problem is...
Any help would be great. Thx