Results 1 to 2 of 2
  1. #1
    jgelpi16 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544

    Question Too few parameters

    This code is driving me absolutely wild! I cannot for the life of me figure out why I keep erroring out. Whenever I run the code I receive a "Too Few Parameters. Expected 1." Run-time error. What am I doing wrong here? The query is based upon a text box on a form. When the user enters a value into the text box the query displays the results. I have verified there are records in the query by opening the query. However, when I run the code it does not work...



    Code:
    Private Sub cmdRunFunction_Click()
    Dim db As DAO.Database, RS As DAO.Recordset
    Set db = CurrentDb
     
        DAO.DBEngine.SetOption dbMaxLocksPerFile, 40000
        Set RS = db.OpenRecordset("qryProc_00", DB_OPEN_DYNASET)
        RS.MoveFirst
        MsgBox RS, vbOKOnly
    End Sub
    Thank you in advance!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You're running into this:

    Too Few Parameters. Expected 1 Error Message

    Another solution is to wrap the form reference in the query in the Eval() function.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Too Few Parameters
    By jgelpi16 in forum Programming
    Replies: 8
    Last Post: 09-27-2010, 01:46 PM
  2. Too Few Parameters - UPDATE SQL
    By jgelpi16 in forum Programming
    Replies: 3
    Last Post: 09-20-2010, 10:11 AM
  3. Too few parameters error.
    By stupesek in forum Forms
    Replies: 5
    Last Post: 09-15-2010, 09:27 AM
  4. Removing parameters
    By katrinanyc926 in forum Reports
    Replies: 1
    Last Post: 08-04-2010, 04:24 PM
  5. Replies: 3
    Last Post: 07-01-2010, 07:55 PM

Tags for this Thread

Posting Permissions

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