I'm doing a stock Control System as a school Project using An Access 2007 DB and Visual Studio 2010. I'm trying to do an update Query based on two variables entered into comboboxes, I cannot get the VB to accept the conditions for this, Can anyone Help me?
Here is my Code
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Query = "update Prod_DB_Completed_Board set [Stock Level] = '" & TextBox2.Text & "' where Laminate = '" & ComboBox2.Text & "'" & "AND" & "'" ComboBox3.Text & "'" Dim cmd As New OleDbCommand con.Open() cmd = New OleDbCommand(Query, con) cmd.ExecuteNonQuery() MsgBox("Stock Updated Successfully", MsgBoxStyle.Information) cmd.Dispose() con.Close() ComboBox2.Text = "" ComboBox3.Text = "" TextBox2.Text = "" End Sub
I Cannot get the Code to recognise the Last "'", is there a way to do this?