"MDW" <(E-Mail Removed)> wrote in news:026f01c3a7b5
$19012350$(E-Mail Removed):
> Say I've got one sub that calls various other subs. If I
> put "On Error Resume Next" in the parent sub (the one
> doing all the calling), will that carry through to the
> child subs (the ones being called)?
No... What happens in this case is that the error generated in a child
sub gets bubbled up to the caller where the Resume Next statement kicks
in. To illustrate:
Sub A()
On Error Resume Next
Call SubB
Msgbox "in SubA"
End Sub
Sub B()
Err.Raise 5
Msgbox "in SubB"
End Sub
In this case, you will never see the msgbox from Sub B but Msgbox from
SubA should display without problems.
If, however, you add Resume Next to Sub B:
Sub B()
On Error Resume next
Err.Raise 5
Msgbox "in SubB"
End Sub
Now, you should see both the msgboxes. (Air code)
PS: 'Inheritance' is a totally unrelated and different term altogether
and doesn't apply in this context.
-- Dev
|