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?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joel Wiseheart

    Opinions on error handling

    Joel Wiseheart, Jul 1, 2003, in forum: Access Forms Coding
    Replies:
    10
    Views:
    135
    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:
    83
    Eric Lommatsch
    Aug 5, 2003
  3. Jen

    Error handling question

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

    Error handling

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

    Turning on/off Error Handling

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

    vba date handling

    Mary, Dec 21, 2004, in forum: Access Forms Coding
    Replies:
    7
    Views:
    75
  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:
    409
    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:
    108
    Bill Cart
    Apr 18, 2006
Loading...