• Error 3061 in function (2003 SP3)

    Author
    Topic
    #457413

    Open form frmISAPDates in attached database and choose the Outreach report to print. The custom function SessionCountOut throws off error 3061. It is failing at the Set rs = line of the code. If you copy the SQL string and paste it into a query, it works fine. A version of this function also works fine in another report. I cannot for the life of me figure out where the problem is.

    Thanks

    Viewing 0 reply threads
    Author
    Replies
    • #1146844

      Although you specify the dates from the form in the SQL string, the query qryOutreach itself also refers to the dates from the form. Since DAO doesn’t know about Access forms, this causes the error. If you remove the condition from qryOutreach, you won’t get the error.

      • #1146855

        Thanks Hans, that makes sense. I needed the parameters in qryOutreach to filter the report for dates. It finally occurred to me to use a second version of qryParameters without the form parameters just for the function and it is now working. the function I adapted it from did the counting from a table so it wasn’t throwing the error. I never would have figured out what was going on without your explanation. I’ve only encountered this error before when there was a clear mistake in the SQL statement.

    Viewing 0 reply threads
    Reply To: Error 3061 in function (2003 SP3)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: