Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New England (Connecticut)
    Posts
    200
    Thanks
    1
    Thanked 0 Times in 0 Posts

    too few parameters error (2003 SP2)

    Hi,
    I am trying to set a reference from word to an access query and am getting a error that says "Run Time Error" "Too few Parameters. Expected 1" error. The code it is stopping on is :

    Set rst = dbs.OpenRecordset("qryRouteSheet", dbOpenDynaset)

    This used to work in 2000 but since our upgrade to 03, it no longer seems to work. Does anyone have any sugesstion?

    Thanks
    Kevin
    Kevin

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: too few parameters error (2003 SP2)

    Is qryRouteSheet a parameter query, or does it refer to a control on a form, or does it use non-standard functions?

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New England (Connecticut)
    Posts
    200
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: too few parameters error (2003 SP2)

    Hans,
    qryRouteSheet is a select query that has "[Forms]![TX-Abroad Packages]![File Number]" in the criteria block where [Forms]![TX-Abroad Packages]![File Number] is referencing a text box on an open form. Hope that helps?
    Kevin

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: too few parameters error (2003 SP2)

    DAO (or ADO) recordsets operate at a lower level than the Access interface. They don't "know" about forms and controls. This has not changed between versions of Access, so I don't understand how this could have worked in Office 2000.
    You'll have to specify a SQL string in which the value of the text box has been substituted instead of the name of the query.

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New England (Connecticut)
    Posts
    200
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: too few parameters error (2003 SP2)

    Thanks Hans,

    I'm sorry about the confusion, I was not reading the code correctly. In the previous version I was talking about, there was a make table query and the reference was set to the table and not the query. The table names and query names were nearly identical. I am not very good a SQL, so if I re-think this and change the query to a make table query, run this ahead of time and set the reference to the table that was created it should work?
    Kevin

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: too few parameters error (2003 SP2)

    Yes, a make-table query is a way to get around the problem of "too few parameters". Your code would open a recordset on the table instead of the query.

  7. #7
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New England (Connecticut)
    Posts
    200
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: too few parameters error (2003 SP2)

    Thanks Hans,

    Up and running.
    Kevin

Posting Permissions

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