Solved

Run time error 381

Posted on 2002-04-17
7
1,354 Views
Last Modified: 2008-03-03
An application developed in VB6 runs perfect in Windows NT, Win2k, win98. But gives error "run-time error '381' - Invalid array index". when run on Windows XP Please suggest.
0
Comment
Question by:sureshrao72
7 Comments
 
LVL 7

Expert Comment

by:Joe_Griffith
ID: 6948850
Your going to have to give more information to get an answer.  Can you post the code that is causing the problem?
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6948975
It appears like a problem with option base (0 or 1) but we need more details as joe saids.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 6949093
listening
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:sureshrao72
ID: 6949171
The Vb code is

Private Sub cboMdlSlsAreaCd_DropDown()
    MousePointer = Default      '041702
    SendKeys "{DOWN}", True
End Sub

The error occurs when definiting the Dropdownbox cboMdlSlsArea_Cd.
0
 

Author Comment

by:sureshrao72
ID: 6949174
Forgot to mention. This happens only at run-time. This does'nt occur at design-time or debugg time.
0
 
LVL 3

Accepted Solution

by:
dannic earned 50 total points
ID: 6949248
You can try to add linenumbers and errorhandler to your code!

Eg.
Private Sub cboMdlSlsAreaCd_DropDown()
   On Error GoTo cboMdlSlsAreaCd_DropDownErr
10
   MousePointer = Default      '041702
20
   SendKeys "{DOWN}", True
30
   Exit Sub
cboMdlSlsAreaCd_DropDownErr:
    Call App.LogEvent("ErrorNumber: " & Err.Number & vbCrLf & _
                       "ErrorSource: " & Err.Source & vbCrLf & _
                       "ErrorDescription: " & Err.Description & vbCrLf & _
                       "Error at line: " & Erl, vbLogEventTypeError)
'Raise error
Err.Raise Err.Number, Err.Source, Err.Description
End Sub

This will help you to locate the statement that make this runtime error.

To see the log you just have to look in the Application log with the Event Viewer.
(Start->Programs->Administrative Tools->Event Viewer)

Good luck
dannic

0
 
LVL 15

Expert Comment

by:ameba
ID: 6949311
In Click event of cboMdlSlsAreaCd you are using its ListIndex property without checking if anything is selected.  Am I right?
If yes, include line "If cboMdlSlsAreaCd.ListIndex > -1 Then" before the line which uses ListIndex.  
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question