• Syntax error (Access 2000)

    Author
    Topic
    #439878

    I am filtering the form depending on the option box called office but i get the syntax error 3075 missing operator.:
    Dim SQL As String
    SQL = ” SELECT [Increment]+[invoice] AS Paymentid, orders.invoicedate, TblPaid.paid, Customers.CompanyName, affiliates.afid, affiliates.CompanyName, orders.paymentid AS invoice” & _
    ” FROM ((orders LEFT JOIN TblPaid ON orders.orderid = TblPaid.orderid) INNER JOIN Customers ON orders.customerid = Customers.Customerid) INNER JOIN affiliates ON Customers.afid = affiliates.afid ” & _
    ” WHERE (((TblPaid.paid)=False Or (TblPaid.paid) Is Null) AND ((orders.paymentid)=True))”
    Dim StrOffice As String
    StrOffice = ” WHERE orders.afid=” & Me.Office & “”
    Me.RecordSource = SQL & StrOffice
    What is wrong with my expression ?

    Viewing 0 reply threads
    Author
    Replies
    • #1052213

      Your SQL string already contains the keyword WHERE, and strOffice adds a second WHERE. A valid SQL string may contain only one WHERE. Change the line that sets strOffice to

      StrOffice = ” AND orders.afid=” & office

    Viewing 0 reply threads
    Reply To: Syntax error (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: