**
i try to insert 10 record under the field year and actual data but only the first text from text1 is entering inside
**
provider = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source ="
dataFile = "db7exmpl.accdb"
connString = provider & dataFile
myConnection.ConnectionString = connString
myConnection.Open()
Dim str As String
'str = " INSERT INTO tb (Years) VALUES('" & TextBox1.Text & "," & TextBox3.Text & "," & TextBox5.Text & "');"
str = "insert into tb ([Years], [Actual_data]) values (?, ?)"
Dim cmd As OleDbCommand = New OleDbCommand(str, myConnection)
cmd.Parameters.Add(New OleDbParameter("Years", CType(TextBox1.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Years", CType(TextBox3.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Years", CType(TextBox5.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Years", CType(TextBox7.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Years", CType(TextBox9.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Years", CType(TextBox11.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Years", CType(TextBox13.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Years", CType(TextBox15.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Years", CType(TextBox17.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Years", CType(TextBox19.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Actual_data", CType(TextBox2.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Actual_data", CType(TextBox4.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Actual_data", CType(TextBox6.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Actual_data", CType(TextBox8.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Actual_data", CType(TextBox10.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Actual_data", CType(TextBox12.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Actual_data", CType(TextBox14.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Actual_data", CType(TextBox16.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Actual_data", CType(TextBox18.Text, String)))
cmd.Parameters.Add(New OleDbParameter("Actual_data", CType(TextBox20.Text, String)))
Try
cmd.ExecuteNonQuery()
'myConnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try