Err value dilema

  • Thread starter Thread starter Tony_VBACoder
  • Start date Start date
T

Tony_VBACoder

I stumbled upon an old code example on the Web that checks
the value of "err", and was trying to clean it up a bit,
when I ran into a dilema as to why the code is behaving
the way it is:

If Err = 71 Then
' Do This....
ElseIf Err = 68 Then
' Do This...
ElseIf Err = 75 Or 76 Then
' Do This...
ElseIf Err = 3043 Then
' Do This...
Else
' Do This...
End If


The problem I have is, if I set a "watch" on the Err
value, and it is 52, for some reason the code jumps into
the ElseIf where Err = 75 or 76. Why is this?????
Shouldn't it gointo the final Else statement?
 
Actually, anything that's not 71 or 68 will stop on that check.

Try: ElseIf Err = 75 Or Err = 76 Then

Good luck.

Sco
 
Yes, that makes sense. Instead, I changed the entire
IfThenElse to a CASE statement.

Thanks
 
Back
Top