Results 1 to 3 of 3
  1. #1
    tomk is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2010
    Posts
    5

    Return without Gosub


    Is there any trick to trace down a "return without gosub" error. Could this also be in a macro?

  2. #2
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    When the error pops up, hit [CTRL]+[Break]. This will pop up your Visual Basic Editor at the exact spot where the error occurred. Just make sure the function you're working in has error trapping turned off (you've commented out the "On Error GoTo" line).

  3. #3
    ExpertNovice is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    4
    (Not familar with 2007, yet.)

    I believe you can leave the On Error statements as is, but change your error trapping option to "Break on All Errors." Good way to fix code you didn't know was not "correct."
    Code:
     
       'For Access 2003
        Application.SetOption "Error Trapping", 2
       '0 = Break on all errors
       '1 = Break in Class  Module
       '2 = Break on Unhandled errors

    Another option is to use standard debugging practices of writing to a log file (or immediate window) in order to watch the flow. Keep narrowing the logging code until you find the problem.


    Depending on the code you might be able to step through.

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

Similar Threads

  1. Tax Return Application
    By Hobbledehoy in forum Access
    Replies: 1
    Last Post: 04-18-2010, 05:41 AM
  2. How do I return the maximum value
    By kam in forum Queries
    Replies: 2
    Last Post: 03-17-2010, 07:38 AM
  3. Return all records from Query
    By ysrini in forum Queries
    Replies: 1
    Last Post: 01-15-2010, 09:52 PM
  4. Return value of row above
    By marimar1097 in forum Access
    Replies: 7
    Last Post: 10-20-2009, 08:06 AM
  5. I need to return a value for calculation.
    By FestoAccessBuilder in forum Access
    Replies: 1
    Last Post: 02-22-2009, 09:58 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