Dear Experts,
I am going to edit what is in the database BUT it still does not work...why..??
VB Code:
Private Sub CommandButton2_Click() Dim con As ADODB.Connection Set con = New ADODB.Connection con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _ & "c:\exercise.mdb" 'update the data Dim strSQL As String strSQL = "UPDATE item " _ & " SET Item_Code = " & TextBox1.Text _ & " WHERE Item_Code = " & Trim$(cmb_item) strSQL = "UPDATE item " _ & " SET Description = " & TextBox2.Text _ & " WHERE Item_Code = " & Trim$(cmb_item) strSQL = "UPDATE item " _ & " SET Qty = " & TextBox3.Text _ & " WHERE Item_Code = " & Trim$(cmb_item) strSQL = "UPDATE item " _ & " SET Unit_Price = " & TextBox4.Text _ & " WHERE Item_Code = " & Trim$(cmb_item) con.Execute strSQL End Sub
Please have a look and let me know what is wrong with this codes...when I click "Update" it wont happen...
Thanks a lot...
Jennifer![]()




Reply With Quote