Runtime error 340 Form_Load event

Posted on 2007-07-22
Last Modified: 2012-06-21
I have a program on my PC written in VB6 (MySQL database) that works when I run it here.  I used INNO SETUP for deployment.  The first form that pops up is a Login Form.  For one of the users, the following error appears after she hits the Login button.

       runtime error '340'
       control array element '1' doesnt exit
       Form = frmMain    Event = Form_Load

All other users can log into the system with no problems.  I uninstalled the program and reinstalled it and now all Userid's work.  Should I be concerned that this might happen again?  How would I best go about debugging issues on a User's system, as I could not recreate the error on my system?
Question by:inkineu
    LVL 13

    Expert Comment

    the best way i guess is to use error handlers in every sub routine, in the error handler open a text file at a particular location and then log the important parameters and the error message. This will help you in getting the error without the need to recreate it.
    LVL 1

    Author Comment

    I do use error handles, ON ERROR GOTO ... , but that would not give me the line where the problem occured.  Is there a way to pickup the line?  My error routines display a message with the Subroutine name, error code and description.  Thanks
    LVL 2

    Accepted Solution

    When an activex control is regstered by an installer, this is (optionally) applied to all users in the All Users registry hive or local machine. Some installers will register it only to the user who is installing it.  In this case, I would suspect there was an issue with the user's profile.

    I wouldn't worry about this too much, it might happen again - but then this is just normal run of the mill
    problems installer apps have to deal with.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now