title: Updating Data in Database MS Access vb.net
body: <pre class="lang-vb prettyprint-override"><code>Private Sub Exe1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      txtScore.Enabled = False
      con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\SJMI.Alfie\Documents\Visual Studio 2010\Projects\WindowsApplication2\WindowsApplication1\Accounts.accdb"
      con.Open()
  End Sub
  Private Sub Submit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Submit.Click
  
      myqry = "UPDATE Accounts SET StudNo=?, Exer1=? WHERE Number=?"
      Cmd = New OleDbCommand(myqry, con)
      Cmd.Parameters.AddWithValue("?", txtScore.Text)
      Cmd.Parameters.AddWithValue("?", myID.Text)
      Cmd.ExecuteNonQuery()
  
      txtScore.Text = score.ToString
      con.Close()
      MsgBox("Thank You!!")
      Login.Show()
      Me.Hide()
  
  End Sub
  </code></pre>
  
  <p>Nothing happens after I click the submit button.</p>