I NEED HELP FOR FIX SOME ERRORS. I WANT TO SAVE MY DETAILS INTO MS ACCESS DATABASE. BUT WHEN I CLICK THE SAVE BUTTON ITS SHOW Syntax error (missing operator) in query expression . I ALREADY FIND THE GOOGLE AND CANT FIX IT MYSELF. SO PLZ HELP ME TO FIX THIS.
Code:Dim strText() As String Dim strDate As String strDate = Me.date1.Text strText = Split(Me.cmbSSelect.Text, vbCrLf) Dim cmd As New OleDb.OleDbCommand If Not rs.State = ConnectionState.Open Then 'open connection if it not yet open rs.Open() End If cmd.Connection = rs 'add data to table cmd.CommandText = "INSERT INTO dpdata(DPNo, DPDate, Supplier, Des, Amount) " & _ " VALUES(" & Me.TextBox2.Text & ",'" & strDate & ",'" & strText(0) & ",'" & Me.TextBox7.Text & ",'" & Me.TextBox4.Text & "')" cmd.ExecuteNonQuery() 'close connection rs.Close() MsgBox("Record Added Successfully")




Reply With Quote
