Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    WCStarks is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Posts
    314

    How to debug a report

    I have a report which has broken. The supporting queries run just fine, but the report, which used to work, now produces and error. I can't find code for the report to enter a breakpoing in. How can I walk through a report in debug mode?

  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,652
    What's the error message? If it's a parameter prompt, you've got something referencing a deleted field or something Access can't find.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    WCStarks is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Posts
    314
    The error is:
    Run-time error" 3071; This expression is typed incorrectly, or it is too complex to be evaluated. For example ....

  4. #4
    WCStarks is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Posts
    314
    not relevant

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Can you post a copy of the database with instructions to highlight the issue? Or the offending expression?
    Hard to offer more than Paul has already without seeing the database.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Hmm, the query runs okay? Have you gone to the last record in the query? Sometimes the error is in a particular record and isn't thrown unless that record is accessed.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    WCStarks is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Posts
    314
    The Stars_Awards report calls Stars_Awards query, which calls Star_AW query. This purpose of this report is to show when each member got their last service star(s) pin and when their next one is due. I can run the Star_AW alone just fine. I can run the Stars_Awards query just fine. But when I run the Report, I get the indicated 3071 error. The report has one expression
    Code:
    =IIf([Yrs]<5,DateAdd("yyyy",5,[Join]),[AwDate])
    I tested running the report with this code removed, but the error still occurs.

    Star_AW query calls ElookUp() three times to get the most recent Membership status for "Award".

    Here is the sanitized version of the db:

    SCATeam.zip

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    AwDate throws an error for the last record in the query, which is likely the source of your problem. That guest record has no join date.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    As a test, I added

    <>"Guest"

    as a criteria on the "Call" field in Star_AW to exclude that record and the report opens fine (entered 2018 for year).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    WCStarks is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Posts
    314
    In the sanitized db I sent you, I forgot to leave "Guest" in the Mem_Name field. I did leave the call sign as is. So, Star_AW should have excluded the guest record by the criteria on Mem_Name. It would not have worked in the sanitized version, however. So you filtering on Call Sign should not have been necessary. Please try it again with "Guest" in the Mem_Name field and see what happens. I added the filter on the Call field, but as expected, the error still occurs. When I look at the result set, No Guest is listed.

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I went to that record and put Guest in the mem_name field and took out the criteria I added. That record does get excluded by your existing criteria and the report opens without error. Do you have any records in your actual db that return #Error in any of the query fields? The guest record caused an error because it had no join date.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #12
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    By the way, if I leave the guest record in and returning #Error in the query, the report throws the error you mention. That leads me to believe that it's the error in the query, not something in the report, that's the source of the problem.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  13. #13
    WCStarks is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Posts
    314
    The [Joined] field in the record is not used is this query. That field, as is the Resigned field, is populated from Membership table via ELookup() functions. The only Member information retrieved from the Members record are the Mem_Name, Call and 1J numbers. The Guest record should not be an issue, as it is excluded from the result set. All the member status information is retrieved directly from the Membership table, with 3 ELookUp() function calls, When I run the queries, I get no error. But when I run the report, I get the error.

  14. #14
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I'm not asking if you get an error message, I'm asking if you see #Error anywhere in the result set. In the sample, the query ran without error, but displayed #Error in that field. The report can't handle that so throws up the error message.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  15. #15
    WCStarks is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Posts
    314
    Thank you. Yes, I see it. It was retrieving a special blank record used to indicate an Event staffing vacancy. That record has ID 51. It was not being excluded. It is also an "Active" record and would be retrieved with the others. I am not sure how that criteria got lost, but I put it in again "ID <> 51", and now the report works. I guess I was overlooking the #error in that last record in the list, subconsciously associating it with the new record at the bottom of any continuous form or table. Very stupid of me. Sorry for the trouble. I am still perplexed at how that criteria got lost, as I don't recall messing with this report since it was run last, but I must have.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Making use of Debug
    By GraeagleBill in forum Programming
    Replies: 5
    Last Post: 05-04-2018, 04:20 PM
  2. Debug warning
    By Jaap in forum Access
    Replies: 5
    Last Post: 10-13-2017, 01:24 PM
  3. Help Debug code
    By joym in forum Access
    Replies: 6
    Last Post: 05-24-2017, 04:15 PM
  4. Can't debug a Sub
    By wardw in forum Programming
    Replies: 6
    Last Post: 10-18-2013, 10:03 AM
  5. Debug
    By gio25 in forum Programming
    Replies: 1
    Last Post: 02-08-2011, 08:30 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