Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2011
    Posts
    8

    Unanswered: Run-Time error 3075 extra) in query or expression

    I am getting Run-Time error 3075 extra) in query or expression'(((Customers.[Customer ID])=))

    VB takes me to this section of code

    Me.RecordSource = "SELECT Jobs.JobID, Jobs.fkCustID, Jobs.Address, Jobs.City, Jobs.ST, " _
    & "Jobs.PostalCode, Jobs.DirectionsToLoc, Customers.[Customer ID] " _
    & "FROM Customers LEFT JOIN Jobs ON Customers.[Customer ID] = Jobs.fkCustID " _
    & "WHERE (((Customers.[Customer ID])=" & sArgs & "));"

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Remove all the parentheses, they're useless in this query.
    Have a nice day!

  3. #3
    Join Date
    Oct 2011
    Posts
    8
    I tried what you said now im getting error 3075 syntax error missing operator in expression

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Remove all the parentheses, they're useless in this query.
    you may need brackets in a JET join

    I thought the line continuation symbol was & _
    ..but I guess it may not matter....
    OK so what is your current SQL?

    best thing I can suggest is to open the query designer, select the SQL view and paste your SQL in there and resolve the issues as they develop.
    replace sArgs with a a value for now.

    prove your query works before plonking it into some VBA, or dispaly the SQL and make certain it looks right

    I nearly always assign SQL to a variable before assigning the SQL to somethign else so its easy to debug. there is often a world of difference between waht you think your SQL is doing and what it actaully is doing. checdk the value of sArgs
    is it s a number or is it a string / text / char.. if the latter it needs to be encapsualted with quote or double quote marks

    dim strSQL as string
    strSQL = "SELECT Jobs.JobID, Jobs.fkCustID, Jobs.Address, Jobs.City, Jobs.ST, " _
    & "Jobs.PostalCode, Jobs.DirectionsToLoc, Customers.[Customer ID] " _
    & "FROM Customers LEFT JOIN Jobs ON Customers.[Customer ID] = Jobs.fkCustID " _
    & "WHERE Customers.[Customer ID])=" & sArgs & ";"
    msgbox (strSQL, "My SQL is",vbinfo) 'temporary debug of sql to make sure it looks right
    Me.RecordSource = strSQL
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Oct 2011
    Posts
    8
    Thankyou that worked but for some reason the form is comming in blank now

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by DAMIENWHITE View Post
    Thankyou that worked but for some reason the form is comming in blank now
    which would suggests there are no rows matching the SQL statement

    have you checked to make certain that your SQL statement makes sense, is doing what you think it is and that there is some data that matches.
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •