I'm using thie code in module and called from Sub. Your way will not service me.
Here is the solution
Dim sql AsString = "Select Name,Company FROM TBaccount"
Dim cmd AsNew OleDbCommand(sql, conn)
Dim dr As OleDbDataReader
conn.Open()
dr = cmd.ExecuteReader
DoWhile dr.Read
Form1.TextBox1.Text = dr("Name")
Form1.TextBox2.Text = dr("Company")
|