Calling Error Handling in VBA

Discussion in 'Access Forms Coding' started by pcm1977, Mar 26, 2013.

  1. pcm1977

    pcm1977 Guest

    I found code that Allen Browne created to capture errors into a table.

    http://allenbrowne.com/ser-23a.html

    The issue I have is how to call it? What do i put in my code at line "3" below to call this Public Function?


    From Allen Browne's Web Site

    1 Sub|Function SomeName()
    2 On Error GoTo Err_SomeName ' Initialize error handling.

    3 ' Code to do something here. ' THIS WHAT I CANNOT FIGURE OUT

    4 Exit_SomeName: ' Label to resume after error.
    5 Exit Sub|Function ' Exit before error handler.
    6 Err_SomeName: ' Label to jump to on error.
    7 MsgBox Err.Number & Err.Description ' Place error handling here.
    8 Resume Exit_SomeName ' Pick up again and quit.
    9 End Sub|Function

    I have tried:

    "Call LogError" = Error Message "Compile Error: Argument not optional"
    "LogError" = Error Message "Compile Error: Argument not optional"
    "LogError()" = "Compile Error: Expected ="
     
    pcm1977, Mar 26, 2013
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Joel Wiseheart

    Opinions on error handling

    Joel Wiseheart, Jul 1, 2003, in forum: Access Forms Coding
    Replies:
    10
    Views:
    161
    Joel Wiseheart
    Jul 1, 2003
  2. Eric Lommatsch

    Error handling not working

    Eric Lommatsch, Aug 5, 2003, in forum: Access Forms Coding
    Replies:
    0
    Views:
    105
    Eric Lommatsch
    Aug 5, 2003
  3. Jen

    Error handling question

    Jen, Aug 9, 2003, in forum: Access Forms Coding
    Replies:
    1
    Views:
    114
  4. m

    Error handling

    m, Sep 3, 2003, in forum: Access Forms Coding
    Replies:
    0
    Views:
    96
  5. sirshannon

    Turning on/off Error Handling

    sirshannon, Sep 11, 2003, in forum: Access Forms Coding
    Replies:
    0
    Views:
    94
    sirshannon
    Sep 11, 2003
  6. Mary

    vba date handling

    Mary, Dec 21, 2004, in forum: Access Forms Coding
    Replies:
    7
    Views:
    111
  7. Savvoulidis Iordanis

    Calling DoCmd.RunCommand acCmdSaveRecord, after calling an API function

    Savvoulidis Iordanis, Mar 14, 2005, in forum: Access Forms Coding
    Replies:
    2
    Views:
    447
    Savvoulidis Iordanis
    Mar 19, 2005
  8. Bill Cart

    VBA error calling parameter query

    Bill Cart, Apr 18, 2006, in forum: Access Forms Coding
    Replies:
    2
    Views:
    148
    Bill Cart
    Apr 18, 2006
Loading...