You are not logged in.

Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

fomaxrge

Trainee

  • "fomaxrge" started this thread

Posts: 88

Date of registration: Aug 14th 2012

  • Send private message

1

Monday, September 10th 2012, 9:05am

2 error goto handlers in one sub

hi again i need your help please.
I want to have 2 error goto handlers in one sub but if i use a code like this returns that "Resume DoCalc:" expected end of statement what i have to do?
OnErrorGoTo ErrHandler1
IfNot Exists(BaseDirectory +"\ARCHIVE")Then _
MkDir BaseDirectory +"\ARCHIVE"

DoCalc:
OnErrorGoTo Errhandler2
intvalue1 =12
intvalue2 =0
intvalue3 = intvalue1 / intvalue

ExitSub

ErrHandler1:
Call MsgBox("Error making directory - "& Err.Number & vbCrLf & Err.Description, vbExclamation, App.Title)
Resume DoCalc:

Errhandler2:
Call MsgBox("Error doing arithmetic - "& Err.Number & vbCrLf & Err.Description, vbExclamation, App.Title)

This post has been edited 1 times, last edit by "fomaxrge" (Sep 10th 2012, 1:32pm)


Rate this thread
WoltLab Burning Board