why do i get syntax error if all are the fields are correct why?:confused:
![Name: chk error.JPG
Views: 120
Size: 165.4 KB]()
Code:
If NewRec Then
Dim NewID As Long
NewID = NextID("ChkID", "Checks")
Dim strSQL As String
strSQL = "INSERT INTO Checks "
strSQL = strSQL & "(ChkID, ChkDate, ChkName, ChkNumber, ChkAccount, ChkBank, ChkBranch, ChkAmount, ChkPaymentDate, ChkDetail, ChkStatus, ChkRemarks, ChkPhoto)"
strSQL = strSQL & "VALUES("
strSQL = strSQL & NewID & ","
strSQL = strSQL & "#" & MyDate(PickDate.Value) & "#,"
strSQL = strSQL & "'" & RplS(Txt(0).text) & "',"
strSQL = strSQL & "'" & RplS(Txt(1).text) & "',"
strSQL = strSQL & "'" & RplS(Txt(2).text) & "',"
strSQL = strSQL & "'" & RplS(Txt(3).text) & "',"
strSQL = strSQL & "'" & RplS(Txt(4).text) & "',"
strSQL = strSQL & CCur(Txt(5).text) & ","
strSQL = strSQL & "#" & MyDate(PckBirth.Value) & "#,"
strSQL = strSQL & "'" & ChkDtl.text & "',"
strSQL = strSQL & "'" & ChkStat.text & "',"
strSQL = strSQL & "'" & RplS(Txt(7).text) & "',"
strSQL = strSQL & "'" & CmmDlg.FileName & "'"
strSQL = strSQL & ")"
CN.Execute strSQL