By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,033 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Function Returning Empty String

P: n/a
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!
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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!
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.