Im currently doing a vb.net project for college and want to create a new access record using textboxes, masked textboxes and richtextboxes using the vb gui. However I keep getting this exception:
"An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll Additional information: Syntax error in INSERT INTO statement."
Here is my code which is working on other forms
Private Sub btnSaveNew_Click(sender As Object, e As EventArgs) Handles btnSaveNew.Click
Dim objrow As DataRow
objrow = objDataSet.Tables("tblEngineersReport").NewRow
objrow.Item("To") = txtTo.Text
objrow.Item("Date_Carried_Out") = txtCompletedDate.Text
objrow.Item("Description_Of_Work") = txtWorkDescription.Text
objrow.Item("Comment") = txtComment.Text
objrow.Item("Quantity1") = txtQuantity1.Text
objrow.Item("Quantity2") = txtQuantity2.Text
objrow.Item("Quantity3") = txtQuantity3.Text
objrow.Item("Quantity4") = txtQuantity4.Text
objrow.Item("Item_Description1") = txtDescription.Text
objrow.Item("Item_Description2") = txtDescription2.Text
objrow.Item("Item_Description3") = txtDescription3.Text
objrow.Item("Item_Description4") = txtDescription4.Text
objrow.Item("Unit_Price1") = txtUnitPrice1.Text
objrow.Item("Unit_Price2") = txtUnitPrice2.Text
objrow.Item("Unit_Price3") = txtUnitPrice3.Text
objrow.Item("Unit_Price4") = txtUnitPrice4.Text
objrow.Item("Rate1") = txtRate1.Text
objrow.Item("Rate2") = txtRate2.Text
objrow.Item("Rate3") = txtRate3.Text
objrow.Item("Labour1") = txtDescription5.Text
objrow.Item("Labour2") = txtDescription6.Text
objrow.Item("Labour3") = txtDescription7.Text
objrow.Item("Hours_Worked1") = txtHours1.Text
objrow.Item("Hours_Worked2") = txtHours2.Text
objrow.Item("Hours_Worked3") = txtHours3.Text
objDataSet.Tables("tblEngineersReport").Rows.Add(objrow)
objEngineerDA.Update(objDataSet, "tblEngineersReport")
Retrieve()
MessageBox.Show("new record added")
cboJobID.Enabled = True
End Sub
the Quanity textboxes down to the hours worked are contained within a table layout panel and am just wondering would this have anything to do with the record not saving?
Text?