Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21189

[RESOLVED] syntax error in query

$
0
0
why do i get syntax error if all are the fields are correct why?:confused:
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

Name:  chk error.JPG
Views: 120
Size:  165.4 KB
Attached Images
 

Viewing all articles
Browse latest Browse all 21189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>