Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2002
    Location
    Washington D.C.
    Posts
    164

    Unanswered: Very Confused using VBA and SQL strings

    I am trying to open a recordset based on a SQL statment and I keep on geting the same error "too few parameters".
    I don't know whats wrong!!!!!!!!!!

    I even refred to a saved query and still keep on getting the error. Do you know what is wrong?

  2. #2
    Join Date
    Jan 2003
    Location
    Dordrecht, The Netherlands
    Posts
    95

    Re: Very Confused using VBA and SQL strings

    Can't tell from your info what's happening exactly.

    1. If you open the saved query, does it ask for parameters? If so, you'll have to set all parameters in the preceding QueryDefinition or Command.

    2. Check the online help for the parameters needed for the Recordset.Open method.

  3. #3
    Join Date
    Jan 2003
    Location
    Aberdeen, Scotland, UK
    Posts
    168

    More Info Needed

    Paste the SQL onto a message so I can see it.

    ThaNX

  4. #4
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    the vb is what we need not the query, that is the the saved queryt he mentioned works
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  5. #5
    Join Date
    Dec 2002
    Location
    Washington D.C.
    Posts
    164

    Re: More Info Needed

    Thanks. It worked.
    But in general can we build a recordset based on a saved query in our db?

    Thanks again.

    Originally posted by johncameron
    Paste the SQL onto a message so I can see it.

    ThaNX

  6. #6
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    yes

    set rs = currentdb.openrecordset("<query Name>")
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

Posting Permissions

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