Results 1 to 4 of 4
  1. #1
    panoss is offline Advanced Beginner
    Windows 7 32bit Access 2003
    Join Date
    Oct 2014
    Posts
    59

    Error handling in start up?


    I have an application.
    When it starts, the macro Autoexec is executed.
    Autoexec calls the function hideStartUp() in a module.

    I have an issue with error handling.

    Code:
    Function hideStartUp()
        On Error GoTo errorHandler
    ...............
    ...............
    ...............
        Exit Function
    errorHandler:
        If Err.Number <> 0 Then MsgBox "deleteRecordOfSubForm " & Error & " " & Err.Number
        Resume Next
    End Function
    When an error happens, it enters in an endless loop: a message box that pops up again and again after closing it.
    The only way to close Access is through task Manager.

    What is wrong with the code?

  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,521
    Is there a loop in the code perhaps? The Resume Next should at least let the code run down to the Exit Function eventually.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    panoss is offline Advanced Beginner
    Windows 7 32bit Access 2003
    Join Date
    Oct 2014
    Posts
    59
    No, there 's no loop.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Hard to tell without seeing the actual code and perhaps what line is causing the initial error. Do you really want it to continue if there's an error, or perhaps replace Resume Next with Resume ExitHandler using the more tradition error handler with an exit point:

    http://www.baldyweb.com/ErrorTrap.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Error handling of table update error?
    By panoss in forum Forms
    Replies: 5
    Last Post: 10-31-2014, 02:06 PM
  2. Error Handling Question - On Error Goto
    By redbull in forum Programming
    Replies: 7
    Last Post: 12-06-2012, 07:54 AM
  3. Replies: 3
    Last Post: 09-05-2012, 10:23 AM
  4. Error 2501 displays with Error handling
    By agent- in forum Programming
    Replies: 13
    Last Post: 08-05-2011, 02:20 PM
  5. #error handling
    By mws5872 in forum Access
    Replies: 4
    Last Post: 05-12-2010, 07:06 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