I would like to use an error function. The first part would be:

Sub EmitError(FunctionCode, Error, ExtraInfo) on error resume next ErrorStr
= Error.Description & "<br/>" & _
Error.Source & "<br/>" & _
Error.number & "<br/>" & _
ExtraInfo


And I would like to call it with:
EmitError "S000101", Err, ""

But when the function is called Error is resetted. Is there a way I could
get this working? It should be called from a lot of places and I would not
like to make in al these places the string instead of in the function.

Re: Is it possible to give Err to a subroutine? by Ray

Ray
Wed Apr 14 09:37:37 CDT 2004

Take the On Error Resume Next out of this sub and see what happens.

Ray at work

"Cecil Westerhof" <someone@microsoft.com> wrote in message
news:ewWNmwiIEHA.2300@tk2msftngp13.phx.gbl...
> I would like to use an error function. The first part would be:
>
> Sub EmitError(FunctionCode, Error, ExtraInfo) on error resume next
ErrorStr
> = Error.Description & "<br/>" & _
> Error.Source & "<br/>" & _
> Error.number & "<br/>" & _
> ExtraInfo
>
>
> And I would like to call it with:
> EmitError "S000101", Err, ""
>
> But when the function is called Error is resetted. Is there a way I could
> get this working? It should be called from a lot of places and I would not
> like to make in al these places the string instead of in the function.
>
>



Re: Is it possible to give Err to a subroutine? by Cecil

Cecil
Thu Apr 15 06:05:03 CDT 2004


"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:uxNlJ4iIEHA.2260@TK2MSFTNGP09.phx.gbl...
> Take the On Error Resume Next out of this sub and see what happens.

I put it after setting ErrorStr and now it works okay. I need the 'On Error
Resume Next' because I do some cleaning up in the subroutine and do not want
an error from this to be displayed.

> "Cecil Westerhof" <someone@microsoft.com> wrote in message
> news:ewWNmwiIEHA.2300@tk2msftngp13.phx.gbl...
> > I would like to use an error function. The first part would be:
> >
> > Sub EmitError(FunctionCode, Error, ExtraInfo) on error resume next
> ErrorStr
> > = Error.Description & "<br/>" & _
> > Error.Source & "<br/>" & _
> > Error.number & "<br/>" & _
> > ExtraInfo
> >
> >
> > And I would like to call it with:
> > EmitError "S000101", Err, ""
> >
> > But when the function is called Error is resetted. Is there a way I
could
> > get this working? It should be called from a lot of places and I would
not
> > like to make in al these places the string instead of in the function.
> >
> >
>
>