Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2012
    Posts
    22

    Unanswered: Too Few Parameters Expected 1

    I have literally been working on this for hours and can't for the life of me figure out what the issue is. Everything works fine except for some reason the part in Bold gives me the Too Few Parameters Expected 1:

    Set CustNums = CurrentDb.OpenRecordset("SELECT CT.[Cust Num]" & _
    "FROM ([Customer Table] AS CT INNER JOIN CSMST AS CS ON CT.[Cust Num] = CS.[CSCUST]) INNER JOIN [Group Members Table] AS GMT ON CT.[CT ID Num] = GMT.[CT ID Num] " & _
    "WHERE ((ct.[Cust Num]) Is Not Null) And ((CS.CSWEB) <> Y) And ((GMT.GroupIDNum) = " & [Forms]![Use Customer for Bid Form]![GroupIDNum] & ") " & _
    "ORDER BY CT.[Cust Num]")

    Is there a specific way I have to write in VBA to <> (not equal something)? Because in a regular query on Access I just put in <> "N" for example and it searches for anything without an N in that column.

    Any help would be appreciated I know this is a topic that is brought up multiple times after surfing the internet looking for an answer.

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Try quotes:

    CS.CSWEB <> "Y"
    Paul

  3. #3
    Join Date
    Apr 2012
    Posts
    22

    Tried it

    I've tried using Quotes "" around the Y and I just get another error-

    Compile error:
    Expected: list separator or )

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    My bad, within VBA use single quotes:

    <> 'Y'
    Paul

  5. #5
    Join Date
    Apr 2012
    Posts
    22
    Thank you pbaldy! Works perfectly, just needed a fresh pair of eyes to look at it I appreciate it.

  6. #6
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Happy to help!
    Paul

Posting Permissions

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