title: SQL insert from select statement
body: <p>what i want the code to do is to take input from a text box ID number then it takes the record which the ID belongs to and insert it in another table but I changed the SQL Statement and still when I press the button nothing happens</p>
  
  <pre><code>Protected Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click
  
  Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source= " &amp; Server.MapPath("~/Members.mdb"))
  
  Dim cmd As New OleDbCommand
  
   Dim i As Integer
  
  cmd.Connection = con
  
   cmd.CommandType = Data.CommandType.Text
  
  cmd.CommandText = "insert into kfupm_stu_visitor (kfupm_stu_id, stu_name, kfupm_maj_id, kfupm_dep_id, level_id) select * from kfupm_stu where fupm_stu_id like @kfupm_stu_id"
          cmd.Parameters.Add("KFUPM_STU_ID", OleDbType.Integer).Value = "%" &amp; txtSTU_ID.Text &amp; "%"
          con.Open()
  
          Try
              i = cmd.ExecuteNonQuery()
          Catch ex As Exception
  
              Response.Redirect("msgpage.aspx?id=1")
          Finally
              con.Close()
              End Try
  
          Response.Redirect("msgpage.aspx?id=2")
  
      End Sub
  </code></pre>