Function Returning Empty String

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • LoopyNZ

    Function Returning Empty String

    Hi,

    I need some detective work done on my code. I have a function that is
    meant to return a string (see below). To a point, it seems to work
    fine, i.e. if I break at Line X, strResult = "By"; if I break at Line Y,
    ExtractElement = "By". However the function is not returning "By", but
    an empty string. How is this possible, and how can I fix it?
    _______________ _________

    Public Function ExtractElement _
    (strLine As String, strOutputType As String) As String

    On Error Goto ErrorHandler

    Dim strResult As String

    ... code ...

    ExitProcedure:
    ExtractElement = strResult 'Line X
    Exit Function 'Line Y

    ErrorHandler:
    MsgBox Err.Description , vbExclamation, "Error " & Err.Number
    strResult = ""
    Resume ExitProcedure

    End Function
    _______________ _________

    Thanks,
    ------------
    LoopyNZ
    ------------

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
  • LoopyNZ

    #2
    Re: Function Returning Empty String

    Apparently I don't need a detective, just a restart of Access. I guess
    my computer was playing a joke on me, the cheeky little devil...

    ------------
    LoopyNZ
    ------------


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!

    Comment

    Working...