Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can i loock "On Error Resume Next" to the hole program

Status
Not open for further replies.

musalk

Programmer
Oct 30, 2001
33
0
0
DK
Can i loock "On Error Resume Next" to the hole program.
So on any error it will proseed the next line. NeoAndresen
ComputerTech/Programmer
 
Yes,

If say clicking a Command Button processes many lines of code, in many modelus, you just put your error handling in the first event which is the Command Button
[tt]
Private Sub Command1_Click()
On Error GoTo Errhandler:
Call MoveNext
ErrHandler:
...
End Sub

Private Sub MoveNext()
Call ChangeRecLocation ("Next")
End Sub

Private Sub ChangeRecLocation (ByVal MoveDirection as String)
...
...
Call DisplayRec
...
End Sub

Private Sub DisplayRec()
...
...
An error Occurs Here
...
End Sub
[/tt]
Now If the error occurs deep down 3 subs in it will kick back out to the first error handler in the Click event. Craig, mailto:sander@cogeco.ca

"Procrastination is the art of keeping up with yesterday."

I hope my post was helpful!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top