title: Getting error on INSERT: "Number of query values and destination fields are not the same"
body: <pre><code>Imports System.Data
  Imports System.Data.OleDb
  
  Public Class form7
      Dim inc As Integer
      Dim con As New OleDb.OleDbConnection
      Dim cmd As OleDbCommand
      Dim dbprovider As String
      Dim dbsource As String
      Dim str As String
      Dim ds As New DataSet
      Dim da As OleDb.OleDbDataAdapter
      Dim TotalRows As Integer
      Dim ID_Number As Integer
  
      Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
          con = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Bank\db1.accdb ")
          con.Open()
          Dim cmd As New OleDbCommand("SELECT COUNT(*) FROM accountsTable", con)
          Dim totalRows As Long = CInt(cmd.ExecuteScalar())
          cmd.ExecuteNonQuery()
          textbox1.Text = totalRows + 1000
      End Sub
  
      Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
          'Form5.Show()
          dbprovider = "Provider=Microsoft.ACE.OLEDB.12.0; dbsource=Data Source=D:\Bank\db1.accdb"
          MsgBox("Database is now open")
          'First_Name,Middle_Name,Last_Name,DOB,Age,Occupation,Marital_Status,Address,Account_Number)
          str = "insert into accountsTable values(" &amp; TextBox1.Text &amp; ",'" &amp; TextBox2.Text &amp; "','" &amp; TextBox3.Text &amp; "','" &amp; TextBox4.Text &amp; "','" &amp; CDate(DateTimePicker1.Text) &amp; "','" &amp; TextBox6.Text &amp; "'," &amp; TextBox7.Text &amp; ",'" &amp; TextBox8.Text &amp; "','" &amp; TextBox9.Text &amp; "','" &amp; ComboBox1.Text &amp; "','" &amp; ComboBox2.Text &amp; "','" &amp; ComboBox3.Text &amp; "','" &amp; ComboBox4.Text &amp; "','" &amp; TextBox10.Text &amp; "','" &amp; TextBox11.Text &amp; "','" &amp; TextBox12.Text &amp; "','" &amp; TextBox13.Text &amp; "')"
          cmd = New OleDb.OleDbCommand(str, con)
          cmd.ExecuteNonQuery()
          MsgBox("Record is inserted")
          con.Close()
  
      End Sub
  
      Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
          TextBox1.Text = ""
          TextBox2.Text = ""
          TextBox3.Text = ""
          TextBox4.Text = ""
          DateTimePicker1.Text = ""
          TextBox6.Text = ""
          TextBox7.Text = ""
          TextBox8.Text = ""
          TextBox9.Text = ""
          ComboBox1.Text = ""
          ComboBox2.Text = ""
          ComboBox3.Text = ""
          TextBox10.Text = ""
          TextBox11.Text = ""
          TextBox12.Text = ""
          TextBox13.Text = ""
          ComboBox4.Text = ""
  
      End Sub
  
      Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
          Me.Close()
          Form3.Show()
      End Sub
  End Class
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/SSJPN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SSJPN.png" alt="Error"></a></p>