Results 1 to 4 of 4
  1. #1
    ssissons is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    May 2014
    Posts
    44

    Access 2007 - OpenRecordSet error - Runtime error '3061'

    We are using Access 2007 (our DBs have issue when we try to open in Access 2010 or 2013).



    In a DB, with VBA code, that has been working for over a year, now it is giving the following error -

    Click image for larger version. 

Name:	access-error.JPG 
Views:	7 
Size:	17.6 KB 
ID:	23870



    (Sorry, pic didn't show as I wanted.)

    It says :

    Runtime error '3061'
    Too few parameters. Expected 1.


    The code in question is this -

    strSelect = "SELECT Requestor, Create_Date, Status, ShortDescription, LongDescription, RequestType, System, AssignedTo, RCAType, Billable, ETA FROM Issues WHERE TTP_No = " & varSelectedTTP
    Set rstIssues = CurrentDb.OpenRecordset(strSelect)

    When I run it, the strSelect is

    SELECT Requestor, [Create_Date], Status, ShortDescription, LongDescription, RequestType, System, AssignedTo, RCAType, Billable, [CBA_EST_ETA] FROM Issues WHERE TTP_No = 1845

    The field names are all spelled correctly, TTP_No is defined in the DB as a Long Integer.

    What parameter does it think is missing, and why did it just start showing the error today, when it has been working for the last year?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Looks okay offhand. If you copy/paste that SQL into a new query, does it open?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ssissons is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    May 2014
    Posts
    44
    Sorry to waste your time. One of the fieldnames in the table had been changed, but didn't get changed in the SQL.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Glad you found the answer.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Runtime Error 3061. Too few parameters, expected 2
    By Gina Maylone in forum Programming
    Replies: 35
    Last Post: 01-13-2014, 02:37 PM
  2. Replies: 7
    Last Post: 07-24-2013, 02:01 PM
  3. Replies: 16
    Last Post: 06-18-2012, 02:27 PM
  4. Replies: 3
    Last Post: 05-30-2012, 01:43 PM
  5. Runtime Error 3061 Expected 3
    By kumail123 in forum Programming
    Replies: 1
    Last Post: 03-28-2012, 09:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums