I don't see the cause of the error.
Screenshot of the error in Debug and the current value of strSQL in the IW:
Screenshot of table:
And, the code: (No error code yet)
Code:
Private Sub cmdSave_Click()
'*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
' Fields TDate, TTypeID, TType, Description and Memo are a part of all records to
' be saved. The fields and values that need to be added are appended depending of
' their current values.
'*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
Dim strSQL As String
Dim strValues As String
strSQL = "INSERT INTO tblRegistry(TDate, TTypeID, TType, Description, TMemo"
strValues = " VALUES(""" & tbNewDate & """," & intNewTTypeID
strValues = strValues & ",""" & tbNewTType & """"
strValues = strValues & ",""" & tbNewDescription & """"
strValues = strValues & ",""" & tbNewMemo & """"
If intNewCatID > 0 Then
strSQL = strSQL & ", CatID"
strValues = strValues & "," & intNewCatID
End If
If intNewSubCatID > 0 Then
strSQL = strSQL & ", SubCatID"
strValues = strValues & "," & intNewSubCatID
End If
If intNewAcctID > 0 Then
strSQL = strSQL & ", AcctID"
strValues = strValues & "," & intNewAcctID
End If
If Not IsNull(tbNewDebit) Then
strSQL = strSQL & ", Debit"
strValues = strValues & "," & tbNewDebit
End If
If Not IsNull(tbNewCredit) Then
strSQL = strSQL & ", Credit"
strValues = strValues & "," & tbNewCredit
End If
strSQL = strSQL & ")"
strValues = strValues & ")"
Debug.Print strSQL & strValues
CurrentDb.Execute strSQL