Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18

Too few parameters. Expected 1.

  1. #16
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    20,617

    The line later that used it:

    Code:
    Me.
    [listSearch].RowSource = strSQL
    was appropriate and probably working. Our point was that you didn't actually do anything with the recordset that used the same SQL string.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  2. #17
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    20,617
    Odd, can't get the line feed out of there. The forum software is adding it, as presumably it did to you.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #18
    SierraJuliet's Avatar
    SierraJuliet is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2017
    Location
    Earth
    Posts
    212
    Quote Originally Posted by SierraJuliet View Post
    After changing CurrentDbOpenRecordset strSQL to DoCmd.RunSQL strSQL it did not work so I changed it back and now I get another error with the following.

    Code:
        aCase = "SELECT CaseNum FROM tblCase WHERE ClientNum Like '" & tClient & "' "
    Code:
    DoCmd.SetFilter , "[CaseNum] Like '" & aCase & "' AND [AssignedDepartmentGroup] Like '" & DepartmentGroup & "' AND [AssignedManagerGroup] Like '" & ManagerGroup & "' OR [AssignedStaff] Like '" & Staff & "'"
    Attachment 37225
    The issue was DoCmd.SetFilter because it uses WHERE Clause and the first part contained SELECT * FROM * Clauses.

    Code:
    DoCmd.SetFilter , "[CaseNum] Like '" & aCase & "' OR [AssignedDepartmentGroup] Like '" & DepartmentGroup & "' AND [AssignedManagerGroup] Like '" & ManagerGroup & "' OR [AssignedStaff] Like '" & Staff & "'"

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Too Few Parameters Expected 9
    By RunTime91 in forum Access
    Replies: 11
    Last Post: 05-31-2018, 07:10 PM
  2. Too Few Parameters. Expected 1
    By flamesofdoom in forum Programming
    Replies: 1
    Last Post: 02-15-2013, 02:23 PM
  3. Too few parameters. expected 1.
    By seth1685 in forum Programming
    Replies: 1
    Last Post: 01-11-2012, 08:08 AM
  4. Too few parameters expected 4
    By forestgump in forum Programming
    Replies: 1
    Last Post: 04-15-2011, 09:10 AM
  5. Too few parameters. Expected 2.
    By PPCMIS2009 in forum Access
    Replies: 0
    Last Post: 01-28-2009, 01:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums