hi, i'm trying to pass a value entered in the previous form and display it in a msgbox. this form has a button which is used to invoke the msg box. here's my coding:

---------------------------------------------------------------------------------
Dim Conn As SqlConnection
Dim Cmd As SqlCommand
Dim Dr As SqlDataReader
Dim StrSQL As String
Dim StrUser As String
Dim DeptTemp As String
Dim Form1 As New Form1()

Conn = New SqlConnection("Initial Catalog=matrixVB;" & _
"Data Source=(local);Integrated Security=SSPI;")

StrUser = Form1.txtLoginID.Text
StrSQL = "SELECT depart_Code FROM Supervisor WHERE Super_ID='" & StrUser & "'"

Cmd = New SqlCommand(StrSQL, Conn)
Conn.Open()

Dr = Cmd.ExecuteReader

While Dr.Read
DeptTemp = Dr("depart_Code")
MsgBox(DeptTemp)
End While

Conn.Close()

End Sub
---------------------------------------------------------------------
i'm suppose to assign the value of txtLoginId in form1 to StrUser, so that the SQL query will work. but somehow nothing came out. what is wrong with this codes? can anyone tell me the proper ways of doing object referencing?