Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2011
    Posts
    19

    Unanswered: Can OpenRecordset be used to open an query?

    I have a form, that when the user enters their data, it updates a query and then opens said query.

    In addition to the query opening and displaying, I want the information from the query to send in an email.

    I have all that code set up properly. The only thing I cannot get this to do is have my VBA open the query so that it can be displayed in the email.

    Archive is the name of my query.

    Dim rsArchive As Object
    Set rsArchive = CurrentDb.OpenRecordset ("Archive")

    When I do this, I receive Run-Time Error 3061 stating:
    Too few parameters. Expected 3.

    Which tells me that it sees it has the three parameters in my query, but for some reason it's unable to access them, or whatever the issue is.

    Any advice?

    Thanks!

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    You're running into this:

    ACC2000: "Too Few Parameters. Expected 1" Error Message

    In addition to the fix there, you may be able to use the Eval() function in the query to get around the error.
    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
  •