Here's my code:
I am using MS Access and I am trying to update a table (InvoiceDetails ) with data input by the user on a form. However, it does not update nor does it give me an error message. Code listed below.
Also, can you recommend a book on SQL.
Thanks.
I am using MS Access and I am trying to update a table (InvoiceDetails ) with data input by the user on a form. However, it does not update nor does it give me an error message. Code listed below.
Also, can you recommend a book on SQL.
Thanks.
Code:
Dim con As Object
Dim rs As ADODB.Recordset
Dim strSql As String
Set con = Application.CurrentProject.Connection
Set rs = New ADODB.Recordset
strSql = "INSERT INTO InvoiceDetails " & _
"(fkInvoiceID, InvD_Employee, Inv_Description) " & _
"SELECT CDO_Invoice.InvoiceNumber, CDOActivity.EmployeeID, " & _
"CDOActivity.Description " & _
"FROM CDO_Invoice, CDOActivity " & _
"WHERE CDOActivity.DateofActivity = " & Me.txtStartDate & " " & _
"AND CDOActivity.fkCDO = " & Me.cboCDO.Value & " ; "
MsgBox strSql
rs.Open strSql, con, 1 ' 1 = adOpenKeyset
Comment