Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Dec 2002
    Location
    Kitchener, Ontario, Canada
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Error 3061 in function (2003 SP3)

    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
    Attached Files Attached Files

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

    Re: Error 3061 in function (2003 SP3)

    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.

  3. #3
    4 Star Lounger
    Join Date
    Dec 2002
    Location
    Kitchener, Ontario, Canada
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error 3061 in function (2003 SP3)

    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.

Posting Permissions

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