View Single Post
  #3 (permalink)  
Old 05-31-2008
Mark G Mark G is offline
Peon
 
Join Date: Apr 2008
Posts: 17
Default

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)....
Reply With Quote