Link to home
Start Free TrialLog in
Avatar of bluedragon99
bluedragon99Flag for United States of America

asked on

Visual basic simple error checking question On error

How do I reset the on error statement?  Example:

on error goto ErrOccured
msgbox "hello world"

'starting here I don't want errors to goto ErrOccured and I may not have any further error checking in place so undesired effects could occur if things went to ErrOccured

BTW is there a way to goto an error trap and then back to your code without goto statements?
Avatar of bluedragon99
bluedragon99
Flag of United States of America image

ASKER

what would be a good way to error check this for example:

Open OptionsFrm.LoggingPath.Text For Append As #2
       Print #2, "Test"
Close #2
ASKER CERTIFIED SOLUTION
Avatar of cookre
cookre
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of WesleySaysHi
WesleySaysHi

Use:

   on error goto ErrOccured

to jump to ErrOccured when there is an error.

Use:

   on error Resume Next

to jump to the next line of code without going to ErrOccured.

This is the most simple way.