I am trying to add new records to a table called ID_ProjectNo in database named Trackingcustomercalls.mdb
The code I have is attached below. It's not working for me.
Please, help me here if you have this problem before.
Any input is valuable to me. Thank you
Private Sub cmdAddSubmit_Click() Dim MyConn As ADODB.connection Set MyConn = New ADODB.connection Dim MyRecSet1 As New ADODB.Recordset MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Amber\Desktop\Trackingcustomercalls\Copy of Trackingcustomercalls.mdb" MyConn.Open Set MyRecSet1 = MyConn.Execute("INSERT INTO ID_ProjectNo VALUES("txtAddProjectNumber.text","txtAddCustomerName.text","txtAddMachine.text")") MyRecSet1.Update MsgBox "The record was added to database", vbCritical, "Succesfull adding" MyConn.Close End Sub