• too few parameters error (2003 SP2)

    Author
    Topic
    #441462

    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

    Viewing 0 reply threads
    Author
    Replies
    • #1060154

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

      • #1060156

        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?

        • #1060158

          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.

          • #1060164

            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?

            • #1060170

              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.

            • #1060538

              Thanks Hans,

              Up and running.

    Viewing 0 reply threads
    Reply To: Reply #1060538 in too few parameters error (2003 SP2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel