Your on error statment
On Error GoTo Command49_Click
is saying got to line labled "Command49_Click:
You have instead named your target error handler line
Err_Command49_Click
rewrite
On Error GoTo Command49_Click
as
On Error GoTo Err_Command49_Click
You do not need to uniquely name a label in the context of the entire program..... Meaning you can use a simpler line label like Err_Handler: and not include the subroutine name.
You also do not have to label the Exit either
Private Sub Command49_Click()
On Error Goto Err_Handler:
'your code goes here
Exit Sub
Err_Handler:
'Your error handling code goes here
End Sub
I know this is mainly for style points, I feel that this is easier to read. Also you are using event keywords like _Click in your lables which confuses exactly where the Click event begins and ends (in terms of readability)....
|