View Single Post
 
Old May 21st, 2010, 09:12 AM
vb5prgrmr vb5prgrmr is offline
Authorized User
 
Join Date: Mar 2009
Posts: 49
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Well, to figure out where the error is coming from, and what line is causing the error, you should have proper error handling for your debug/beta testing. As an example...
Code:
Private Sub Form_Load()
 
On Error GoTo Form_LoadError
 
Exit Sub
Form_LoadError:
 
MsgBox "FormName.Form_Load " & Err.Number & ":" & Err.Description
 
End Sub
You can also add line numbers and use Erl (see MZTools for a nice addin for VB6.0 dev environment) to track down exactly which line is causing the problem. Also, put Option Explicit at the top of each code window, as this will force you to declare everything. Then if you have any On Error Resume or On Error Resume Next or On Error GoTo 0, remove them for proper error handling and in the future so you do not have to add this manually, goto tools>options and put a checkmark next to Require Variable Declarations. Then any new projects will automatically have Option Explicit at the top of each code window...



Good Luck