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

[RESOLVED] syntax error missing in query expression

$
0
0
hey
im getting a error every time i try to update a field " syntax error missing in query expression"
i checked the code i dont know whats wrong.
this is the code when i load the form
Code:

Private Sub Form_Load()
    Me.WindowState = 2
    LsVw.ColumnHeaders(1).Icon = "asc"
    Set RS = CN.Execute("SELECT * FROM Expenses ORDER BY ExpDate")
    While Not RS.EOF
        Set Itm = LsVw.ListItems.Add(, , Format(RS!ExpDate, "dd/mm/yyyy"), , "dolar")
        Itm.Tag = RS!ExpID
        Itm.SubItems(1) = RS!ExpType
        Itm.SubItems(2) = RS!ExpQuantity
        Itm.SubItems(3) = FormatCurrency(RS!ExpCost)
        RS.MoveNext
    Wend
    ListRTL LsVw
        mLVClrHdr.HookToLV LsVw.hwnd, True
    mLVClrHdr.glHdrBkClr = &HD1B499
    mLVClrHdr.glHdrTextClr = vbWhite
    m_hookedLV = True
End Sub

and this is when i edit , i get the error
Code:

CN.Execute ("UPDATE Expenses SET " & _
                "ExpDate= #" & MyDate(PickDate.Value) & "#, " & _
                "ExpType= '" & RplS(txt(1).text) & "', " & _
                "ExpQuantity= " & Replace$(txt(2).text, ",", ".") & ", " & _
                "ExpCost= " & Replace$(txt(3).text, ",", ".") & _
                " WHERE ExpID= " & .Tag)

tnx for the help

Viewing all articles
Browse latest Browse all 21246

Trending Articles



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