Results 1 to 6 of 6

Thread: RTE 3601 (2003)

  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    RTE 3601 (2003)

    Hi All,
    I am trying to do this

    Set db = CurrentDb
    strOldRev = "select * from tblEstimateItems where [tblEstimateItems].[estimate_id] = 24689-Q"
    Set rsOldRev = db.OpenRecordset(strOldRev)

    and I am getting (RTE 3601, too few parameters. Expected 1 error) on the line where it tries to open the recordset. I use this method all the time to open tables and it has never failed before. I am sure I have records with 24689-Q in them but still this error comes. Anybody have any ideas?

    Thanks,
    Mark

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

    Re: RTE 3601 (2003)

    String values must be enclosed in single or double quotes. Double quotes within a quoted string must be doubled, so you can use either
    <code>
    strOldRev = "select * from tblEstimateItems where [tblEstimateItems].[estimate_id] = '24689-Q'"
    </code>
    or
    <code>
    strOldRev = "select * from tblEstimateItems where [tblEstimateItems].[estimate_id] = ""24689-Q"""
    </code>
    See <!post=Chr() function and quotes within strings (all),230516>Chr() function and quotes within strings (all)<!/post> for more info.

  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: RTE 3601 (2003)

    For a start you should enclose the value 24689-Q in single quotes.

    However the error you are getting is one of the variables is misspelt (eg estimate_id has not been spelled properly), maybe it thinks 24689-Q is a field in your query.

  4. #4
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: RTE 3601 (2003)

    Hi Hans and Patt,
    This is what I had originally and it gave the same error. I have verified that the name is in fact spelled correctly. I was able to put the value in with the correct quotes and it worked. However, I need the thing to work with the value that is in the field when the user clicks the button.

    Set db = CurrentDb
    strEstID = Me.Text0
    strOldRev = "select * from tblEstimateItems where [Estimate_ID] = " & strEstID
    Set rsOldRev = db.OpenRecordset(strOldRev)

    I included a couple of screen captures here.

    Thanks for the help!

    Mark
    Attached Images Attached Images

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

    Re: RTE 3601 (2003)

    Same problem - the text value must be enclosed in quotes.

    strOldRev = "select * from tblEstimateItems where [Estimate_ID] = " & Chr(34) & strEstID & Chr(34)

    Please follow the link in my previous reply!

  6. #6
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: RTE 3601 (2003)

    Hi Hans,
    Thanks and I played around with it and got it to work. I replied but then deleted the post as I had some other stuff in the reply. I really should have edited it instead.

    Take care,
    Mark

Posting Permissions

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