VB6 Check Boxes

Posted on 2006-05-02
Last Modified: 2010-05-01
I have a group of check boxes. They get populated with information from a database. When a user clicks the checkbox, it is supposed to save that new value. My problem is that if those boxes already have value in the database, when it is loading that information to the screen, it thinks the user click the check box, and goes to try and save it. This does not take up much time but it is a waste of resources to do all this work. Can I have my cake and eat it too?
Question by:arajoe
    1 Comment
    LVL 13

    Accepted Solution

    You'll need to set a module-level flag indicating that the form is loading.  Like:

    (declarations section)
    Private mLoading As Boolean

    (in the code where you're populating the controls)
        mLoading = True
        ' populate the controls
        mLoading = False

    (in the click event for the checkboxes)
        If mLoading Then Exit Sub


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
    If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
    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…
    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…

    779 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

    12 Experts available now in Live!

    Get 1:1 Help Now