locked
Runtime VBA Error 3061: Too Few Parameters. Expected 1. RRS feed

  • Question

  • Ok, so I know that a few people have asked this question before, however, I have not seen anything that looks like this before.

    Basically, I have this:

        StartTime = Now()
        Processed = "Yes"
        Emailed = "Yes"
        Set dbCurr = CurrentDb
        Set rsCurr = dbCurr.OpenRecordset("SELECT * FROM Priority_Report WHERE Active = True;")
        
        rsCurr.MoveFirst

    The Set rsCurr = dbCurr.OpenRecordset("SELECT * FROM Priority_Report WHERE Active = True;") line is where the error is happening, but I have no idea what is causing it. All of the fields are in the table that is being called, and in fact the query runs really well when I put it into a SQL Window and hit run.

    Anything would be great at this point.


    Best regards, Mike

    Wednesday, May 11, 2016 10:36 PM

Answers

All replies

  • Hi Mike. Did Priority_Report happen to be a parameter query rather than a table? If so, the parameter needs to be resolved first. See if this function can help: Generic Recordset.
    Wednesday, May 11, 2016 11:30 PM
  • Hi dzitam,

    I try to execute it on my side and it work correctly.

    here I want to ask you that is it the real query from that you get error or you have posted to show a demo.

    if it not a query that gives you an error please try to post the query from that you are getting an error.

    if it is the query from that you are getting an error then did you try to execute an another query to check it work or not ?

    Regards

    Deepak


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, May 12, 2016 9:37 AM
  • The Set rsCurr = dbCurr.OpenRecordset("SELECT * FROM Priority_Report WHERE Active = True;") line is where the error is happening, but I have no idea what is causing it. All of the fields are in the table that is being called, and in fact the query runs really well when I put it into a SQL Window and hit run.

    Hi dzitam,

    You typically get this error when the field in the Where-clause is not found. Is "Active" a valid field?

    Imb.

    Thursday, May 12, 2016 10:04 AM
  • I get this error when column Active does not exist in the database table Priority_Report. Please check.

    Best regards, George



    Thursday, May 12, 2016 12:27 PM
  • Hi dzitam,

    I agree with the suggestion given by the George.B.Summers and Imb-hb please check your query again and verify that you have spell the column name correctly in the query.

    Regards

    Deepak


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, May 13, 2016 9:10 AM