Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Too Few Parameters (A2k/xp)

    I get the infamous "Too few parameters, expected 1" message on this line of code:

    Set rs = db.OpenRecordset("qryTeenAdventureCampLetter", dbOpenDynaset)

    Any and all assistance is appreciated. TIA.

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

    Re: Too Few Parameters (A2k/xp)

    You will get this error if qryTeenAdventureCampLetter has a parameter in the Criteria line, e.g. [Enter Last Name] or something similar, or if it refers to a control on a form, e.g. [Forms]![frmDataEntry]![txtLastName]. Does one of these apply?

  3. #3
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Too Few Parameters (A2k/xp)

    It has a parameter that refers to a control on a form.

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

    Re: Too Few Parameters (A2k/xp)

    Say that your query refers to [Forms]![frmDataEntry]![txtLastName]
    You can change the code as follows:

    Dim qdf As DAO.QueryDef
    Set qdf = db.QueryDefs("qryTeenAdventureCampLetter")
    qdf.Parameters("[Forms]![frmDataEntry]![txtLastName]") = [Forms]![frmDataEntry]![txtLastName]
    Set rs = qdf.OpenRecordSet(dbOpenDynaset)

  5. #5
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Too Few Parameters (A2k/xp)

    Thanks much, Hans.

Posting Permissions

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