I know about On Error Resume Next and On Error Goto ... But I was wondering if could do something like On Error Exit Sub or On Error Then ....
Can what I'm asking be done?
Printable View
I know about On Error Resume Next and On Error Goto ... But I was wondering if could do something like On Error Exit Sub or On Error Then ....
Can what I'm asking be done?
What would be the use of that?Quote:
Originally posted by Xerpher
I know about On Error Resume Next and On Error Goto ... But I was wondering if could do something like On Error Exit Sub or On Error Then ....
Can what I'm asking be done?
VB Code:
Private Sub Form_Click() On error goto line1: 'CODE 'CODE line1: End sub
And
VB Code:
Private Sub Form_Click() On error goto line1: 'CODE 'CODE Exit sub line1: 'CODE 'CODE End sub
What exactly do you want it to do when it faults?
I was kinda thinking of having something like
On Error Then MsgBox "Error"
You know what I mean? but I guess I'll just have to use the goto... I was just curious, Thanks you guys.
VB Code:
Private Sub Form_Click() On error goto line1: 'CODE 'CODE Exit sub line1: 'CODE Msgbox "Error" End sub