[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Run time error 381

Posted on 2002-04-17
7
Medium Priority
?
1,361 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 101

Expert Comment

by:mlmcc
ID: 6949093
listening
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 150 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

650 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